Files
official-images/test/tests/python-sqlite3/container.py
T
2015-02-05 10:58:53 -08:00

13 lines
361 B
Python

import sqlite3
ver = sqlite3.sqlite_version
con = sqlite3.connect(':memory:', 1, sqlite3.PARSE_DECLTYPES, None)
cur = con.cursor()
cur.execute('CREATE TABLE test (id INT, txt TEXT)')
cur.execute('INSERT INTO test VALUES (?, ?)', (42, 'wut'))
cur.execute('SELECT * FROM test')
assert(cur.fetchall() == [(42, 'wut')])
cur.execute('DROP TABLE test')
con.close()