Sqlite

A clearskies SQLite cursor.

  1. Overview
  2. database
  3. autocommit
  4. connect_timeout

Overview

This class provides a SQLite cursor implementation with support for connection configuration and SQL formatting.

Configuration

The following parameters are available (with their default values):

  • database: Path or name of the SQLite database file (example.db)
  • autocommit: Whether to autocommit transactions (True)
  • connect_timeout: Connection timeout in seconds (2.0)

Example

import clearskies

cursor = clearskies.cursors.Sqlite(
    database="example.db",
    autocommit=True,
    connect_timeout=2.0,
)
cursor.execute("SELECT * FROM users")
results = cursor.fetchall()

database

Optional

Path or name of the SQLite database file.

autocommit

Optional

Whether to automatically commit transactions.

connect_timeout

Optional

Connection timeout in seconds.