Skip to content

SQLite

To connect to an SQLite database, is possible to import the SQLiteConnector class from the hamana.connector.db.sqlite module. As a shortcut, the SQLiteConnector class is also available in the hamana.connector.db module as SQLite.

import hamana as hm

# connect database
sqlite_db = hm.connector.db.SQLite("database.db")

# perform operations
# ...

hamana.connector.db.sqlite

SQLiteConnector

SQLiteConnector(path: str, **kwargs: dict[str, Any])

Bases: BaseConnector

Class representing a connector to a SQLite database.

Source code in src/hamana/connector/db/sqlite.py
17
18
19
20
def __init__(self, path: str, **kwargs: dict[str, Any]) -> None:
    self.path = path
    self.kwargs = kwargs
    self.connection: Connection