Skip to content

Commit

Permalink
doctest sqlite test
Browse files Browse the repository at this point in the history
  • Loading branch information
artemisart committed Feb 5, 2024
1 parent 7411376 commit 42f0b25
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functional/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,9 +1715,10 @@ def to_sqlite3(
The table schema is inferred from the elements in the sequence
if only target table name is supplied.
>>> conn = sqlite3.connect(':memory:')
>>> _ = conn.execute('CREATE TABLE user (id int, name text)')
>>> seq([(1, 'Tom'), (2, 'Jack')])\
.to_sqlite3('examples/users.db', 'INSERT INTO user (id, name) VALUES (?, ?)')
.to_sqlite3(conn, 'INSERT INTO user (id, name) VALUES (?, ?)')
>>> seq([{'id': 1, 'name': 'Tom'}, {'id': 2, 'name': 'Jack'}]).to_sqlite3(conn, 'user')
:param conn: path or sqlite connection, cursor
Expand Down

0 comments on commit 42f0b25

Please sign in to comment.