Belle II Software  release-06-01-15
SQLiteDB Class Reference
Inheritance diagram for SQLiteDB:

Public Member Functions

def __init__ (self, database_path, schema=None, read_only=False, timeout=5.0, isolation_level=None)
 
def __enter__ (self)
 
def __exit__ (self, type, value, traceback)
 
def close (self)
 
def open (self)
 
def commit (self)
 
def query (self, sql, parameters=tuple())
 
def create_schema (self)
 
def get_uri (self)
 

Public Attributes

 database_path
 
 schema
 
 conn
 
 read_only
 
 timeout
 
 isolation_level
 

Detailed Description

Parameters:
  database_path (pathlib.Path): The path to the database file we want to create/connect to.

Keyword Arguments:
  schema (dict): Database table schema for the DB of the form:
                 {"tablename": ["columnname1 text primary key",
                                "columnname2 int"]
                 }
  read_only (bool): Should the connection be treated as a read-only connection (no update/insert calls)
  timeout (float): What timeout value should the connection have. How long to wait for other changes to commit.
  isolation_level (str): How should the connection behave when making transactions?
    Choices are [None, "DEFERRED", "IMMEDIATE", "EXCLUSIVE"] where None is autocommit behaviour.

Definition at line 18 of file database.py.


The documentation for this class was generated from the following file: