plasoscaffolder.dal package¶
Submodules¶
plasoscaffolder.dal.base_database_information module¶
Base class for the Information for the SQLite Database
-
class
plasoscaffolder.dal.base_database_information.BaseDatabaseInformation[source]¶ Bases:
objectBase class representing the SQLite Query validator.
-
GetTableColumnsAndType(table: str, all_lowercase=False) → [<class 'str'>][source]¶ Returns the table information from the database
Parameters: - table (str) – the name of the table
- all_lowercase (bool) – if the table name and the type should be returned in lower case
Returns: - the table information, with the name of the column and the
type of the column
Return type: {name, type}
-
plasoscaffolder.dal.base_explain_query_plan module¶
Base class for the explain query plan.
-
class
plasoscaffolder.dal.base_explain_query_plan.BaseExplainQueryPlan[source]¶ Bases:
objectBase class representing the explain query plan.
plasoscaffolder.dal.base_sql_query_execution module¶
The SQLite Query validator.
-
class
plasoscaffolder.dal.base_sql_query_execution.BaseSQLQueryExecution[source]¶ Bases:
objectClass representing the SQLite query validator.
-
ExecuteQuery(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query.
Parameters: query (str) – The SQL Query to execute on the SQLite database. Returns: The data to the Query Return type: sql_query_data.SQLQueryData
-
ExecuteQueryDetailed(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query and gets detailed information.
Parameters: query (str) – The SQL Query to execute on the SQLite database. Returns: The data to the Query Return type: sql_query_data.SQLQueryData
-
ExecuteReadOnlyQuery(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query if it is read only, and valid to parse.
Parameters: query (str) – the SQL Query to execute on the SQLite database Returns: the data to the Query Return type: sql_query_data.SQLQueryData
-
plasoscaffolder.dal.base_type_helper module¶
Base SQLite Type Helper.
-
class
plasoscaffolder.dal.base_type_helper.BaseTypeHelper[source]¶ Bases:
objectBase class representing the type helper for SQLite.
-
AddMissingTypesFromSchema(columns: [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>], query: str) → [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>][source]¶ Getting Information for the column out of the cursor.
Parameters: - columns ([sql_query_column_model.SQLColumnModel]) – the columns with all the column names
- query – the query
Returns: a list with all the columns
Return type:
-
GetColumnInformationFromDescription(description: []) → [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>][source]¶ Getting Information for the column out of the cursor.
Parameters: description – the description of the cursor Returns: - a list with all the column
- names, the types are None
Return type: [sql_query_column_model.SQLColumnModel]
-
GetDuplicateColumnNames(columns: plasoscaffolder.model.sql_query_column_model.SQLColumnModel) → [<class 'str'>][source]¶ - Find out if the query has duplicate column names and if a alias is
- needed.
Parameters: columns (sql_query_column_model.SQLColumnModel) – all columns parsed from the cursor Returns: - a list of all the duplicate column names, if its empty it means it
- is a distinct list of columns
Return type: [str]
-
plasoscaffolder.dal.explain_query_plan module¶
Class for the explain query plan.
-
class
plasoscaffolder.dal.explain_query_plan.ExplainQueryPlan(sql_execution: plasoscaffolder.dal.base_sql_query_execution.BaseSQLQueryExecution)[source]¶ Bases:
plasoscaffolder.dal.base_explain_query_plan.BaseExplainQueryPlanClass representing the explain query plan.
plasoscaffolder.dal.sql_query_data module¶
Data class for the SQL Query
-
class
plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Bases:
objectThe Data to the executed query.
-
has_error¶ bool – if the query execution was erroneous
-
data¶ [str] – the rows returned after execution
-
error_message¶ str – the error message if the query was erroneous
-
columns¶ [sql_query_column_model.SQLColumnModel] – the column names of the query
-
plasoscaffolder.dal.sqlite_database_information module¶
Information for the SQLite Database.
-
class
plasoscaffolder.dal.sqlite_database_information.SQLiteDatabaseInformation(sql_execution: plasoscaffolder.dal.base_sql_query_execution.BaseSQLQueryExecution)[source]¶ Bases:
plasoscaffolder.dal.base_database_information.BaseDatabaseInformationClass representing the SQLite Query validator.
-
GetTableColumnsAndType(table: str, all_lowercase: bool = False) → [<class 'str'>][source]¶ Returns the table information from the database
Parameters: - table (str) – the name of the table
- all_lowercase (bool) – if the table name and the type should be returned in lower case
Returns: - the table information, with the name of the column and the
type of the column
Return type: {name, type}
-
plasoscaffolder.dal.sqlite_query_execution module¶
SQLite Query Execution
-
class
plasoscaffolder.dal.sqlite_query_execution.SQLiteQueryExecution(database_path: str)[source]¶ Bases:
plasoscaffolder.dal.base_sql_query_execution.BaseSQLQueryExecutionClass representing the SQLite Query validator.
-
ExecuteQuery(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query.
Parameters: query (str) – The SQL Query to execute on the SQLite database. Returns: The data to the Query Return type: sql_query_data.SQLQueryData
-
ExecuteQueryDetailed(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query and gets detailed information.
Parameters: query (str) – The SQL Query to execute on the SQLite database. Returns: The data to the Query Return type: sql_query_data.SQLQueryData
-
ExecuteReadOnlyQuery(query: str) → plasoscaffolder.dal.sql_query_data.SQLQueryData[source]¶ Executes the SQL Query if it is read only, and valid to parse.
Parameters: query (str) – the SQL Query to execute on the SQLite database Returns: the data to the Query Return type: sql_query_data.SQLQueryData
-
plasoscaffolder.dal.sqlite_type_helper module¶
SQLite Type Helper.
-
class
plasoscaffolder.dal.sqlite_type_helper.SQLiteTypeHelper(execution: plasoscaffolder.dal.base_sql_query_execution.BaseSQLQueryExecution, explain: plasoscaffolder.dal.base_explain_query_plan.BaseExplainQueryPlan, database_information: plasoscaffolder.dal.base_database_information.BaseDatabaseInformation)[source]¶ Bases:
plasoscaffolder.dal.base_type_helper.BaseTypeHelperClass representing the type helper for SQLite.
-
AddMissingTypesFromSchema(columns: [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>], query: str) → [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>][source]¶ Getting Information for the column out of the cursor.
Parameters: - columns ([sql_query_column_model.SQLColumnModel]) – the columns with all the column names
- query – the query
Returns: a list with all the columns
Return type:
-
GetColumnInformationFromDescription(descriptions: []) → [<class 'plasoscaffolder.model.sql_query_column_model.SQLColumnModel'>][source]¶ Getting Information for the column out of the cursor.
Parameters: descriptions – the descriptions of the cursor Returns: - a list with all the column
- names, the types are None
Return type: [sql_query_column_model.SQLColumnModel]
-
GetDuplicateColumnNames(columns: plasoscaffolder.model.sql_query_column_model.SQLColumnModel) → [<class 'str'>][source]¶ - Find out if the query has duplicate column names and if a alias is
- needed.
Parameters: columns (sql_query_column_model.SQLColumnModel) – all columns parsed from the cursor Returns: - a list of all the duplicate column names, if its empty it means it
- is a distinct list of columns
Return type: [str]
-