dissect.database.sqlite3.util¶
Module Contents¶
Functions¶
Split a string on comma's ( |
|
Parse |
|
Splits the column definition to name and constraint. |
|
Finds a primary key from sql string. |
- dissect.database.sqlite3.util.split_sql_list(sql: str) collections.abc.Iterator[str]¶
Split a string on comma’s (
,) while ignoring any comma’s contained within an arbitrary level of nested braces (( )).
- dissect.database.sqlite3.util.parse_table_columns_constraints(sql: str) tuple[str | None, list[str], list[str]]¶
Parse
SQL CREATE TABLEstatements and return the primary key, column definitions and table constraints.The retrun value is a tuple of:
(primary_key, [column, …], [table_constraint, …]) where column is a tuple of: (column_name, column_type_constraint)
- dissect.database.sqlite3.util.split_column_def(sql: str, column_def: str) tuple[str, str]¶
Splits the column definition to name and constraint.
- dissect.database.sqlite3.util.get_primary_key_from_constraint(column_type_constraint: str, column_def: str, sql: str) str | None¶
Finds a primary key from sql string.