Source: factory.core/extend.data/ObjDataDDL.py
| Method | Signature | Description |
|---|---|---|
| get_collation | get_collation() -> str |
Retrieves the database collation setting from the system configuration. |
| get_package | get_package() -> str |
Retrieves and caches the active package in uppercase. |
| get_package_and_archetype | get_package_and_archetype() -> tuple[str, str] |
Retrieves and caches active package + archetype. |
| escape_sql | escape_sql(item_str: str) -> str |
Escape SQL string value for safe inline literal usage. |
| has_table | has_table(table: str, remote: DatabaseConnectionType = 0) -> bool |
Determines if a specific table exists in the database. The function checks |
| rename_column | rename_column(table: str, from_field: str, to_field: str, field_type: str = '') -> None |
Renames a column in the specified table. |
| sql_get_primary_key | sql_get_primary_key(table_name: str) -> list |
Retrieves the primary key column name for a given table. |
| get_columns | get_columns(table_reference: str, remote: DatabaseConnectionType = 0) -> List[str] |
Retrieves a list of column names for a given table, for different database types. |
| has_column | has_column(table: str, column_name: str, db: DatabaseConnectionType | str = '') -> bool |
Checks if a specific column exists in the given table. |
| get_column_type | get_column_type(table_base: str, column_name: str) -> tuple |
Retrieves the data type and maximum length of a specific column in a table. |
| add_column | add_column(table_name: str, column_name: str, column_type: str) -> int |
Adds a new column to the specified table if it does not already exist. |
| add_columns | add_columns(table: str, columns_to_add: list[tuple]) -> None |
Adds multiple columns to the specified table. |
| delete_column | delete_column(table_name: str, column_name: str) -> None |
Deletes a column from a table if it exists. |