Server¶
- class tinyolap.server.Server
Represents a TinyOlap server instance serving one or more databases. Only needed when multiple databases need to be served through a single object.
- add_database(database: tinyolap.database.Database) tinyolap.database.Database
Adds a database to the server :param database: The database to be added.
- create_database(name: str, in_memory: bool = True, overwrite_existing: bool = False)
Creates a new database. If parameter
in_memory``is set to ``True
, no database file will be created. For that case, all changes made to the database and data entered or imported will be lost after your application has shut down.If parameter
in_memory``is set to ``False
(the default settings), then a database file will be created in the folder ‘db’ aside your script root. If a database with the same name already exists, then the old database file will be renamed and a new database file will be created. Renaming simply appends a timestamp.Danger
If parameter
in_memory``is set to ``True
and parameteroverwrite_existing
is also set toTrue
then an any existing database file will be deleted/overwritten.- Parameters
overwrite_existing – Identifies that an already existing database file with the
same name will be overwritten. :param name: The name of the database to be created. Special characters are not supported for database names. :param in_memory: Defines if the database should operate in-memory only, without persistence (all data will be lost after your application will shut down) or, if set to
False
, with an SQLite file storage_provider.
- deletes_database(name: str)
Deletes a database from the filesystem. Handle with care.
- open_database(database_file: str)
Opens an existing database.
- database_filestr
A full qualified path to database file.
- reinitialize()
Re-initializes the server. This forces all allocated resources to be released.