Skip to content

Commit de294a8

Browse files
committed
Update api.html
1 parent b7eebfc commit de294a8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/api.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<li><a href="#db-table">table()</a></li>
8888
<li><a href="#db-truncate">truncate()</a></li>
8989
<li><a href="#db-update">update()</a></li>
90+
<li><a href="#db-upsert">upsert()</a></li>
9091
<li><a href="#db-value">value()</a></li>
9192
<li><a href="#db-where">where()</a></li>
9293
</ul>
@@ -155,7 +156,7 @@ <h3 class="h4" id="db-having">having(string $value=null)</h3>
155156
</section>
156157
<section>
157158
<h3 class="h4" id="db-insert">insert(array $data, $modifiers=null)</h3>
158-
<p>Available modifiers are: <code>LOW_PRIORITY</code>, <code>DELAYED</code>,
159+
<p>Insert record in the database. Available modifiers are: <code>LOW_PRIORITY</code>, <code>DELAYED</code>,
159160
<code>HIGH_PRIORITY</code>, <code>IGNORE</code></p>
160161
<pre class="prettyprint">$db->insert(['name'=>'John']);
161162
$db->insert(['name'=>'John'], 'IGNORE');</pre>
@@ -221,6 +222,13 @@ <h3 class="h4" id="db-update">update(array $data, $modifiers=null)</h3>
221222
<p>Update records in the database. Available modifiers are: <code>LOW_PRIORITY</code>, <code>IGNORE</code></p>
222223
<pre class="prettyprint">$db->update(['name'=>'Peter']);
223224
$db->update(['name'=>'Peter'], 'IGNORE');</pre>
225+
</section>
226+
<section>
227+
<h3 class="h4" id="db-upsert">upsert(array $data, $modifiers=null)</h3>
228+
<p>Insert new records or update the existing ones. Available modifiers are: <code>LOW_PRIORITY</code>, <code>DELAYED</code>,
229+
<code>HIGH_PRIORITY</code>, <code>IGNORE</code></p>
230+
<pre class="prettyprint">$db->upsert(['email'=>'peter@gmail.com','name'=>'Peter Schmidt']);
231+
$db->upsert(['email'=>'peter@gmail.com','name'=>'Peter Schmidt'], 'LOW_PRIORITY');</pre>
224232
</section>
225233
<section>
226234
<h3 class="h4" id="db-value">value(string $column)</h3>

0 commit comments

Comments
 (0)