bluepyparallel.database¶
Module used to provide a simple API to a database in which the results are stored.
Classes
|
A simple API to manage the database in which the results are inserted using SQLAlchemy. |
- class bluepyparallel.database.DataBase(url, *args, create=False, **kwargs)¶
Bases:
objectA simple API to manage the database in which the results are inserted using SQLAlchemy.
- Parameters:
url (str) – The URL of the database following the RFC-1738 format ( https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls)
create (bool) – If set to True, the database will be automatically created by the constructor.
kwargs (args and) – They will be passed to the
sqlalchemy.create_engine()function.
- property connection¶
Get a connection to the database.
- create(df, table_name=None, schema_name=None)¶
Create a table in the database in which the results will be written.
- db_exists()¶
Check that the server and the database exist.
- exists(table_name, schema_name=None)¶
Check that the table exists in the database.
- get_url()¶
Get the URL of the database.
- load()¶
Load the table data from the database.
- reflect(table_name, schema_name=None)¶
Reflect the table from the database.
- write(row_id, result=None, exception=None, **input_values)¶
Write a result entry or an exception into the table.
- write_batch(columns, data)¶
Write entries from a list of lists into the table.