pysqlite3-binary

0.5.4.post2 · active · verified Mon Apr 13

This library takes the SQLite module from Python 3 and packages it as a separately-installable module. The binary package is statically compiled, which makes it easy to embed the library and ensures a recent SQLite version with many features enabled, such as FTS (Full-Text Search), user-defined window functions, and native backup API. It is currently at version 0.5.4.post2 and is actively maintained.

Warnings

Install

Imports

Quickstart

Demonstrates connecting to an in-memory SQLite database, creating a table, inserting data, querying, and closing the connection using the pysqlite3 module.

import pysqlite3

conn = pysqlite3.connect(':memory:')
cursor = conn.cursor()

cursor.execute('CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT, email TEXT)')
cursor.execute('INSERT INTO users (name, email) VALUES (?, ?)', ('Alice', 'alice@example.com'))
cursor.execute('INSERT INTO users (name, email) VALUES (?, ?)', ('Bob', 'bob@example.com'))

conn.commit()

for row in cursor.execute('SELECT * FROM users'):
    print(row)

conn.close()

view raw JSON →