mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 02:14:31 +02:00
Add an example of --text too, refs #404
This commit is contained in:
parent
7142dbd58d
commit
e7f040106b
2 changed files with 17 additions and 2 deletions
|
|
@ -1158,6 +1158,13 @@ def insert(
|
|||
|
||||
If you are using --lines your code will be passed a "line" variable,
|
||||
and for --text a "text" variable.
|
||||
|
||||
When using --text your function can return an iterator of rows to
|
||||
insert. This example inserts one record per word in the input:
|
||||
|
||||
\b
|
||||
echo 'A bunch of words' | sqlite-utils insert words.db words - \\
|
||||
--text --convert '({"word": w} for w in text.split())'
|
||||
"""
|
||||
try:
|
||||
insert_upsert_implementation(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue