Skip to main content

pydbc driver for SQLite — wraps stdlib sqlite3 (qmark paramstyle)

Project description

alt-python-pydbc-sqlite

pydbc driver for SQLite via the Python standard-library sqlite3 module. Zero external dependencies.


Installation

uv add alt-python-pydbc-sqlite

URL formats

Format Description
pydbc:sqlite::memory: In-memory database (isolated per connection)
pydbc:sqlite:./path/to/db File-backed database
pydbc:sqlite:/absolute/path/to/db File-backed database (absolute path)

Usage

import pydbc_sqlite  # registers SQLiteDriver with DriverManager
from pydbc_core import DriverManager

conn = DriverManager.get_connection("pydbc:sqlite::memory:")
stmt = conn.create_statement()
rs = stmt.execute_query("SELECT 1 AS n")
print(rs.rows)   # [(1,)]
conn.close()

Parameterised queries

# Positional parameters
stmt = conn.create_statement()
rs = stmt.execute_query("SELECT * FROM users WHERE id = ?", (42,))

# Named parameters
rs = stmt.execute_query("SELECT * FROM users WHERE id = :id", {"id": 42})

Prepared statements

ps = conn.prepare_statement("INSERT INTO users (name, email) VALUES (?, ?)")
ps.execute_update(("Alice", "alice@example.com"))
ps.execute_update(("Bob", "bob@example.com"))
conn.commit()

Paramstyle note

sqlite3 uses qmark (?) placeholders internally. pydbc accepts both ? (positional) and :name (named) syntax and translates automatically — you never need to know which style the underlying driver uses.


Documentation


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alt_python_pydbc_sqlite-1.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alt_python_pydbc_sqlite-1.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file alt_python_pydbc_sqlite-1.1.0.tar.gz.

File metadata

  • Download URL: alt_python_pydbc_sqlite-1.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alt_python_pydbc_sqlite-1.1.0.tar.gz
Algorithm Hash digest
SHA256 1a6126e3be8353fdaade72a6125fa8ec530621ac186156453f279e0561df375f
MD5 51efb5d3dec899b428a44afb4a0644d0
BLAKE2b-256 f609f70da971f775ab8a3d05b11c52a709cabeffc1e48005c21dfe463262daa5

See more details on using hashes here.

File details

Details for the file alt_python_pydbc_sqlite-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: alt_python_pydbc_sqlite-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for alt_python_pydbc_sqlite-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 738e0005a9745632bf077c504b13278393815e951150663a173bf4e1743e7839
MD5 3b25b50828618af2fdd9ebba1c59d981
BLAKE2b-256 6aa2d09b135c529482890cfb551609257aab93ae8c3c966de2d6ce3952d8a1ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page