Skip to content

class PandaSQLiteDB

Marcel Ferrari edited this page Mar 2, 2023 · 5 revisions

The PandaSQLiteDB class is the main interface for managing and storing data in the underlying SQLite database.

Constructor

PandaSQLite(db_path: str, auto_commit: bool = True, verbose: bool = False)
  • db_path: path to the database. If the database does not exist it will be created.
  • auto_commit: auto commit after each operation on the database. This option ensures that the updates to the database are saved periodically after each operation. If this feature is disable it is important to call the commit() method before the program terminates (or the Jupyter notebook is closed).
  • 'verbose': enable verbosity. This option enables print statements when executing SQL queries.

Functions

Query operations

Table operations

Database operations

Example

# Open database "example.sql"
db = PandaSQLDB("example.sql")

# Open database "example.sql" with auto-commit disabled and verbosity enabled
db = PandaSQLDB("example.sql", auto_commit = False, verbose = True)