Skip to content

Commit c74b251

Browse files
committed
Add change guide
1 parent 9aa5758 commit c74b251

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

user_guide_src/source/changelogs/v4.3.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Enhancements
4343
- Added ``spark filter:check`` command to check the filters for a route. See :ref:`Controller Filters <spark-filter-check>` for the details.
4444
- Now **Encryption** can decrypt data encrypted with CI3's Encryption. See :ref:`encryption-compatible-with-ci3`.
4545
- Now ``spark routes`` command shows route names. See :ref:`URI Routing <routing-spark-routes>`.
46+
- ``BaseConnection::escape()`` now excludes the ``RawSql`` data type. This allows passing SQL strings into data. See :ref:`database-queries-db-escape`.
4647

4748
Changes
4849
*******
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<?php
22

3-
$data = [
4-
'title' => 'My title',
5-
'name' => 'My Name',
6-
'date' => 'My date',
7-
];
3+
$data = [
4+
'id' => new RawSql('DEFAULT'),
5+
'title' => 'My title',
6+
'name' => 'My Name',
7+
'date' => '2022-01-01',
8+
'last_update' => new RawSql('CURRENT_TIMESTAMP()'),
9+
];
810

9-
$builder->insert($data);
10-
// Produces: INSERT INTO mytable (title, name, date) VALUES ('My title', 'My name', 'My date')
11+
$builder->insert($data);
12+
/* Produces:
13+
INSERT INTO mytable (id, title, name, date, last_update)
14+
VALUES (DEFAULT, 'My title', 'My name', '2022-01-01', CURRENT_TIMESTAMP())
15+
*/

0 commit comments

Comments
 (0)