Database¶
Description
-
class
lab_utils.database.
Database
(config_file: str = None)[source]¶ Manages connections and operations with a PostgreSQL database. The class is based on the library
psycopg2
and on this tutorial.Methods
Initializes the
Database
object.Checks if a column exists in a given table.
Checks if a table exists.
Closes the connection to the database.
Loads the configuration.
Connects to the database.
Creates a TimescaleDB table.
Creates a new column in a given table.
Inserts data into a given table.