![]() |
Baby Language Lab Scripts
A collection of data processing tools.
|
This class provides all the functionality of database.py, but using an in-memory database (non-persistent). More...
Public Member Functions | |
def | __init__ |
Constructor. More... | |
def | dump_to_file |
Writes this in-memory database to a *.db file on disk. More... | |
![]() | |
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 | |
![]() | |
conn | |
cursor | |
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.
def db.mem_database.MemDatabase.__init__ | ( | self | ) |
def db.mem_database.MemDatabase.dump_to_file | ( | self, | |
filename | |||
) |
Writes this in-memory database to a *.db file on disk.
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.