Database and Connection#
- featherstore.connection.connect(connection_string)[source]#
Connects to a database.
- Parameters:
connection_string (str) – Path to the database directory
- Raises:
NotADatabaseError – If
connection_stringis not a FeatherStore database.TypeError – If
connection_stringis not a str.
- featherstore.connection.disconnect()[source]#
Disconnects from the current database.
- Raises:
NotConnectedError – If FeatherStore is not connected to a database.
- featherstore.connection.create_database(path, *, errors='raise', connect=True)[source]#
Creates a new database.
- Parameters:
path (str) – Where to create the database.
errors (str, optional) – Whether or not to raise an error if the database directory already exist. Can be either raise or ignore, ignore tries to create a database in existing directory, by default raise
connect (bool) – Whether or not to connect to the created database, by default True
- Raises:
PopulatedDirectoryError – If
errors='raise'and the directory is not empty.TypeError – If
db_pathis not a str.ValueError – If
errorsis not'raise'or'ignore'.
- featherstore.connection.current_db()[source]#
Fetches the active database.
- Returns:
The current database directory
- Return type:
str
- Raises:
NotConnectedError – If FeatherStore is not connected to a database.