Skip to content

Commit 0a2f0c7

Browse files
committed
docs: add section titles for UpsertBatch
1 parent 6df4911 commit 0a2f0c7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

user_guide_src/source/database/query_builder.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,18 +954,26 @@ $builder->upsertBatch()
954954

955955
.. versionadded:: 4.3.0
956956

957+
Upsert from Data
958+
^^^^^^^^^^^^^^^^
959+
957960
Generates an upsert string based on the data you supply, and runs the
958961
query. You can either pass an **array** or an **object** to the
959962
method. By default a constraint will be defined in order. A primary
960963
key will be selected first and then unique keys. MySQL will use any
961-
constraint by default. Here is an example using an array:
964+
constraint by default.
965+
966+
Here is an example using an array:
962967

963968
.. literalinclude:: query_builder/108.php
964969

965970
The first parameter is an associative array of values.
966971

967972
.. note:: All values are escaped automatically producing safer queries.
968973

974+
Upsert from a Query
975+
^^^^^^^^^^^^^^^^^^^
976+
969977
You can also upsert from a query:
970978

971979
.. literalinclude:: query_builder/115.php

0 commit comments

Comments
 (0)