@@ -878,6 +878,9 @@ insertBatch
878878$builder->insertBatch()
879879-----------------------
880880
881+ Insert from Data
882+ ^^^^^^^^^^^^^^^^
883+
881884Generates an insert string based on the data you supply, and runs the
882885query. You can either pass an **array ** or an **object ** to the
883886method. Here is an example using an array:
@@ -890,6 +893,9 @@ The first parameter is an associative array of values.
890893
891894.. warning :: When you use ``RawSql``, you MUST escape the data manually. Failure to do so could result in SQL injections.
892895
896+ Insert from a Query
897+ ^^^^^^^^^^^^^^^^^^^
898+
893899You can also insert from a query:
894900
895901.. literalinclude :: query_builder/117.php
@@ -954,18 +960,26 @@ $builder->upsertBatch()
954960
955961.. versionadded :: 4.3.0
956962
963+ Upsert from Data
964+ ^^^^^^^^^^^^^^^^
965+
957966Generates an upsert string based on the data you supply, and runs the
958967query. You can either pass an **array ** or an **object ** to the
959968method. By default a constraint will be defined in order. A primary
960969key will be selected first and then unique keys. MySQL will use any
961- constraint by default. Here is an example using an array:
970+ constraint by default.
971+
972+ Here is an example using an array:
962973
963974.. literalinclude :: query_builder/108.php
964975
965976The first parameter is an associative array of values.
966977
967978.. note :: All values are escaped automatically producing safer queries.
968979
980+ Upsert from a Query
981+ ^^^^^^^^^^^^^^^^^^^
982+
969983You can also upsert from a query:
970984
971985.. literalinclude :: query_builder/115.php
@@ -1096,6 +1110,16 @@ Or as an array:
10961110You may also use the ``$builder->set() `` method described above when
10971111performing updates.
10981112
1113+ $builder->getCompiledUpdate()
1114+ -----------------------------
1115+
1116+ This works exactly the same way as ``$builder->getCompiledInsert() `` except
1117+ that it produces an **UPDATE ** SQL string instead of an **INSERT ** SQL string.
1118+
1119+ For more information view documentation for `$builder->getCompiledInsert() `_.
1120+
1121+ .. note :: This method doesn't work for batched updates.
1122+
10991123.. _update-batch :
11001124
11011125UpdateBatch
@@ -1141,16 +1165,6 @@ Since v4.3.0, you can also update from a query with the ``setQueryAsData()`` met
11411165
11421166.. note :: It is required to alias the columns of the select query to match those of the target table.
11431167
1144- $builder->getCompiledUpdate()
1145- -----------------------------
1146-
1147- This works exactly the same way as ``$builder->getCompiledInsert() `` except
1148- that it produces an **UPDATE ** SQL string instead of an **INSERT ** SQL string.
1149-
1150- For more information view documentation for ``$builder->getCompiledInsert() ``.
1151-
1152- .. note :: This method doesn't work for batched updates.
1153-
11541168*************
11551169Deleting Data
11561170*************
@@ -1174,27 +1188,42 @@ the data to the first parameter of the method:
11741188If you want to delete all data from a table, you can use the ``truncate() ``
11751189method, or ``emptyTable() ``.
11761190
1191+ $builder->getCompiledDelete()
1192+ -----------------------------
1193+
1194+ This works exactly the same way as ``$builder->getCompiledInsert() `` except
1195+ that it produces a **DELETE ** SQL string instead of an **INSERT ** SQL string.
1196+
1197+ For more information view documentation for `$builder->getCompiledInsert() `_.
1198+
11771199.. _delete-batch :
11781200
1201+ DeleteBatch
1202+ ===========
1203+
11791204$builder->deleteBatch()
11801205-----------------------
11811206
11821207.. versionadded :: 4.3.0
11831208
1209+ Delete from Data
1210+ ^^^^^^^^^^^^^^^^
1211+
11841212Generates a batch **DELETE ** statement based on a set of data.
11851213
11861214.. literalinclude :: query_builder/118.php
11871215
11881216This method may be especially useful when deleting data in a table with a composite primary key.
11891217
1190- .. note :: SQLite does not support the use of ``where()``.
1218+ .. note :: SQLite3 does not support the use of ``where()``.
1219+
1220+ Delete from a Query
1221+ ^^^^^^^^^^^^^^^^^^^
11911222
11921223You can also delete from a query:
11931224
11941225.. literalinclude :: query_builder/119.php
11951226
1196- .. note :: ``$deleteBatch()`` can be used since v4.3.0.
1197-
11981227$builder->emptyTable()
11991228----------------------
12001229
@@ -1213,14 +1242,6 @@ Generates a **TRUNCATE** SQL string and runs the query.
12131242.. note :: If the TRUNCATE command isn't available, ``truncate()`` will
12141243 execute as "DELETE FROM table".
12151244
1216- $builder->getCompiledDelete()
1217- -----------------------------
1218-
1219- This works exactly the same way as ``$builder->getCompiledInsert() `` except
1220- that it produces a **DELETE ** SQL string instead of an **INSERT ** SQL string.
1221-
1222- For more information view documentation for ``$builder->getCompiledInsert() ``.
1223-
12241245**********************
12251246Conditional Statements
12261247**********************
0 commit comments