Baby Language Lab Scripts
A collection of data processing tools.
 All Classes Namespaces Files Functions Variables Pages
db.mem_database.MemDatabase Class Reference

This class provides all the functionality of database.py, but using an in-memory database (non-persistent). More...

Inheritance diagram for db.mem_database.MemDatabase:

Public Member Functions

def __init__
 Constructor. More...
 
def dump_to_file
 Writes this in-memory database to a *.db file on disk. More...
 
- Public Member Functions inherited from db.database.Database
def __init__
 Constructor. More...
 
def close
 Closes the database connection, releasing any resources that it was using. More...
 
def execute_stmt
 Executes a verbatim SQL statement. More...
 
def execute_script
 Reads and executes a sql script file. More...
 
def insert
 Inserts one or more rows into a table in the database. More...
 
def select
 Selects rows from a table in the database. More...
 
def delete
 Deletes rows from a table in the database. More...
 
def update_timestamp_col
 Updates the value of a timestamp column to the current date/time. More...
 
def update
 Updates rows in a table. More...
 
def write_to_file
 Writes out all of the data in a table to a csv file. More...
 

Additional Inherited Members

- Public Attributes inherited from db.database.Database
 conn
 
 cursor
 

Detailed Description

This class provides all the functionality of database.py, but using an in-memory database (non-persistent).

An in-memory database is significantly faster than a disk-based one. This can be useful if you want simple SQL-query/sort functionality to sift through some data. You can build youself a temporary DB and even dump the results to a csv file when you're done. See CSVDatabase.py for more info on that sort of thing.

Definition at line 9 of file mem_database.py.

Constructor & Destructor Documentation

def db.mem_database.MemDatabase.__init__ (   self)

Constructor.

Parameters
self

Definition at line 12 of file mem_database.py.

Member Function Documentation

def db.mem_database.MemDatabase.dump_to_file (   self,
  filename 
)

Writes this in-memory database to a *.db file on disk.

Parameters
self
filename(string) path to the *.db file you wish to write to (will be created if it doesn't exist)

Definition at line 19 of file mem_database.py.


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