Documentation fix for executemany()

This commit is contained in:
Georg Richter
2020-06-08 11:52:35 +02:00
parent 75c41497c5
commit 9a24ee4402
4 changed files with 34 additions and 4 deletions

View File

@ -89,8 +89,18 @@ Cursor methods
]
cursor.executemany("INSERT INTO colleagues VALUES (?, ?, ?)", data)
To insert special values like NULL or a column default, you need to specify indicators:
- mariadb.indicator_null is used for NULL values
- mariadb.indicator_ignore is used to skip update of a column.
- mariadb.indicator_default is used for a default value (insert/update)
- mariadb.indicator_row is used to skip update/insert of the entire row.
.. note::
Indicator objects can only be used when connecting to a MariaDB Server 10.2 or newer. Older versions of MariaDB and MySQL servers don't support this feature.
- All values for a column must have the same data type.
- Indicators can only be used when connecting to a MariaDB Server 10.2 or newer. Older versions of MariaDB and MySQL servers don't support this feature.
.. method:: fetchall()

View File

@ -135,9 +135,19 @@ tuple represents data of a row within a table.
<span class="n">cursor</span><span class="o">.</span><span class="n">executemany</span><span class="p">(</span><span class="s2">&quot;INSERT INTO colleagues VALUES (?, ?, ?)&quot;</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
</pre></div>
</div>
<p>To insert special values like NULL or a column default, you need to specify indicators:</p>
<ul class="simple">
<li><p>mariadb.indicator_null is used for NULL values</p></li>
<li><p>mariadb.indicator_ignore is used to skip update of a column.</p></li>
<li><p>mariadb.indicator_default is used for a default value (insert/update)</p></li>
<li><p>mariadb.indicator_row is used to skip update/insert of the entire row.</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Indicator objects can only be used when connecting to a MariaDB Server 10.2 or newer. Older versions of MariaDB and MySQL servers dont support this feature.</p>
<ul class="simple">
<li><p>All values for a column must have the same data type.</p></li>
<li><p>Indicators can only be used when connecting to a MariaDB Server 10.2 or newer. Older versions of MariaDB and MySQL servers dont support this feature.</p></li>
</ul>
</div>
</dd></dl>

File diff suppressed because one or more lines are too long