Database.new_column¶
-
Database.
new_column
(table_name: str, column_name: str, data_type: lab_utils.database.DataType, constraints: list = None)[source]¶ Creates a new column in a given table.
If the column already exists, it just returns. If the table does not exist or the column could not be created, it raises a
psycopg2.Error
.- Parameters
- Raises
TypeError – Invalid constraint or data type
ValueError – Invalid constraint or data type
psycopg2.Error – Base exception for all kind of database errors