![]() |
Qorus Integration Engine®
4.1.4.p4_git
|
the main sqlutil service class More...
Inherits QorusSystemService.
Static Public Member Methods | |
static | init () |
initalizes the system sqlutil service | |
static *hash< auto > | select (string ds, string table, *hash< auto > sh) |
executes the select method on the given datasource and table and returns the result More... | |
static *list< auto > | select_rows (string ds, string table, *hash< auto > sh) |
executes the selectRows method on the given datasource and table and returns the result More... | |
static *hash< auto > | select_row (string ds, string table, *hash< auto > sh) |
executes the selectRow method on the given datasource and table and returns the result More... | |
static int | insert (string ds, string table, softlist< auto > rl) |
executes the insert method on the given datasource and table with the given data and returns the number of rows inserted in a single transaction More... | |
static int | insert_from_select (string ds, string table, list< auto > cols, string source_table, hash< auto > sh) |
executes the insertFromSelect method on the given datasource and table and returns the result More... | |
static int | update (string ds, string table, hash< auto > set, *hash< auto > cond) |
executes the update method on the given datasource and table with the given data and returns the number of rows updated in a single transaction More... | |
static int | upsert_row (string ds, string table, hash< auto > row, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt) |
executes the upsert() method on the given datasource and table with the given input data and returns the result of the upsert operation More... | |
static hash< auto > | upsert (string ds, string table, softlist< auto > rows, int upsert_strategy=AbstractTable::UpsertAuto, *hash< auto > opt) |
executes the upsertFromIterator() method on the given datasource and table with the given input data and returns a hash giving the result of the upsert operation More... | |
static int | del (string ds, string table, *hash< auto > cond) |
executes the delete method on the given datasource and table with the given data and returns the number of rows deleted in a single transaction More... | |
static nothing | truncate_table (string ds, string table) |
executes the truncate method on the given datasource and table More... | |
static *hash< auto > | align_schema (string ds, hash< auto > schema_template, *hash< auto > opt) |
aligns a schema with the given template and returns a hash with two keys: "info" : a list of informational strings about the result of processing, and "sql" : a list of the SQL executed More... | |
static *hash< auto > | drop_schema (string ds, hash< auto > schema_template, *hash< auto > opt) |
drops the given schema and returns a hash with two keys: "info" : a list of informational strings about the result of processing, and "sql" : a list of the SQL executed More... | |
static *hash< auto > | align_table (string ds, string table_name, hash< auto > table_template, *hash< auto > opt) |
aligns a schema with the given template and returns a hash with two keys: "info" : a list of informational strings about the result of processing, and "sql" : a list of the SQL executed More... | |
static *hash< auto > | drop_table (string ds, string table, *hash< auto > opt) |
drops the listed table and returns information about the operation executed More... | |
static list< auto > | list_functions (string ds) |
returns a list of strings giving the names of all functions in the given datasource More... | |
static list< auto > | list_procedures (string ds) |
returns a list of strings giving the names of all procedures in the given datasource More... | |
static list< auto > | list_sequences (string ds) |
returns a list of strings giving the names of all sequences in the given datasource More... | |
static list< auto > | list_tables (string ds) |
returns a list of strings giving the names of all tables in the given datasource More... | |
static bool | exists_table (string ds, string table) |
returns True if the given table exists in the given datasource More... | |
static list< auto > | list_views (string ds) |
returns a list of strings giving the names of all views in the given datasource More... | |
static *string | get_table_ddl (string ds, string table, *hash< auto > opt) |
returns the DDL for a table or NOTHING if the object does not exist or is not accessible More... | |
static list< auto > | get_sequence_ddl (string ds, string name, *hash opt) |
returns the DDL for a sequence or NOTHING if the object does not exist or is not accessible More... | |
static list< auto > | get_function_ddl (string ds, string name, *hash< auto > opt) |
returns the DDL for a function or NOTHING if the object does not exist or is not accessible More... | |
static list< auto > | get_procedure_ddl (string ds, string name, *hash< auto > opt) |
returns the DDL for a stored procedure or NOTHING if the object does not exist or is not accessible More... | |
static list< auto > | get_view_ddl (string ds, string name, *hash< auto > opt) |
returns the DDL for a view or NOTHING if the object does not exist or is not accessible More... | |
static auto | exec_sql (string ds, string sql) |
executes SQL in the given datasource with option arguments and returns a hash of the results More... | |
static auto | exec_raw_sql (string ds, string sql) |
executes raw SQL in the given datasource and returns a hash of the results More... | |
static hash< auto > | describe_table (string ds, string table) |
returns a hash describing the given table More... | |
static hash< auto > | describe_query (string ds, string sql) |
returns a hash describing the results of an SQL query More... | |
the main sqlutil service class
|
inlinestatic |
aligns a schema with the given template and returns a hash with two keys: "info"
: a list of informational strings about the result of processing, and "sql"
: a list of the SQL executed
ds | the datasource name of the schema to align |
schema_template | a schema template hash; see SqlUtil::AbstractDatabase::getAlignSql() for more information |
opt | a schema alignment option hash; see SqlUtil::AbstractDatabase::getAlignSql() for more information |
"info"
: a list of informational strings about the result of processing"sql"
: a list of the SQL executedAn implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
|
inlinestatic |
aligns a schema with the given template and returns a hash with two keys: "info"
: a list of informational strings about the result of processing, and "sql"
: a list of the SQL executed
ds | the datasource name of the schema where the table will be aligned |
table_name | the name of the table to align |
table_template | a table description hash; see SqlUtil::AbstractTable::getAlignSql() for more information |
opt | a table alignment hash; see SqlUtil::AbstractTable::getAlignSql() for more information |
"info"
: a list of informational strings about the result of processing"sql"
: a list of the SQL executedAn implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
executes the delete method on the given datasource and table with the given data and returns the number of rows deleted in a single transaction
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
returns a hash describing the results of an SQL query
ds | the name of the datasource |
sql | the select statement to describe |
... | any bind arguments to the select statement |
returns a hash describing the given table
ds | the name of the datasource |
table | the name of the table |
native_type
(string): the native DB typeqore_type
(*string): the equivalent Qore type, if knownsize
(int): the size of the column, if relevantnullable
(bool): if the column can hold NULL
valuesdef_val
(*string): the default value code for the column, if anycomment
(*string): any comment on the column
|
inlinestatic |
drops the given schema and returns a hash with two keys: "info"
: a list of informational strings about the result of processing, and "sql"
: a list of the SQL executed
ds | the datasource name of the schema to drop |
schema_template | a schema template hash; see SqlUtil::AbstractDatabase::getDropSchemaSql() for more information |
opt | a schema drop option hash; see SqlUtil::AbstractDatabase::getDropSchemaSql() for more information |
"info"
: a list of informational strings about the result of processing"sql"
: a list of the SQL executedAn implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
drops the listed table and returns information about the operation executed
ds | the datasource the table resides in |
table | the name of the table to drop |
opt | options for the drop operation (see SqlUtil::AbstractTable::getDropSql()) |
"info"
: one or more informative strings about the SQL operations executed"sql"
: one or more DDL strings giving the actual SQL DDL commands executedAn implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
executes raw SQL in the given datasource and returns a hash of the results
ds | the name of the datasource |
sql | the SQL to execute |
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
executes SQL in the given datasource with option arguments and returns a hash of the results
ds | the name of the datasource |
sql | the SQL to execute |
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
returns True if the given table exists in the given datasource
|
inlinestatic |
returns the DDL for a function or NOTHING if the object does not exist or is not accessible
|
inlinestatic |
returns the DDL for a stored procedure or NOTHING if the object does not exist or is not accessible
returns the DDL for a sequence or NOTHING if the object does not exist or is not accessible
returns the DDL for a table or NOTHING if the object does not exist or is not accessible
returns the DDL for a view or NOTHING if the object does not exist or is not accessible
executes the insert method on the given datasource and table with the given data and returns the number of rows inserted in a single transaction
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
|
inlinestatic |
executes the insertFromSelect method on the given datasource and table and returns the result
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
returns a list of strings giving the names of all functions in the given datasource
returns a list of strings giving the names of all procedures in the given datasource
returns a list of strings giving the names of all sequences in the given datasource
returns a list of strings giving the names of all tables in the given datasource
returns a list of strings giving the names of all views in the given datasource
executes the select method on the given datasource and table and returns the result
executes the selectRow method on the given datasource and table and returns the result
executes the selectRows method on the given datasource and table and returns the result
executes the truncate method on the given datasource and table
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
|
inlinestatic |
executes the update method on the given datasource and table with the given data and returns the number of rows updated in a single transaction
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
|
inlinestatic |
executes the upsertFromIterator() method on the given datasource and table with the given input data and returns a hash giving the result of the upsert operation
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
ds | the datasource name |
table | the table name |
rows | the row data to insert |
upsert_strategy | see Upsert Strategy Codes for possible values for the upsert strategy |
opt | a hash of options for the upsert operation; see SqlUtil::AbstractTable::UpsertOptions for common options; each driver can support additional driver-specific options |
"inserted"
: the number of rows inserted"verified"
: the number of rows updated unconditionally; note that this key is returned with all upsert strategy codes other than SqlUtil::AbstractTable::UpsertSelectFirst instead of "updated"
"updated"
: the number of rows updated; note that this key is only returned if upsert_strategy is SqlUtil::AbstractTable::UpsertSelectFirst, otherwise updated rows are reported as "verified"
since rows are updated unconditionally with other the upsert strategy codes"unchanged"
: the number of rows unchanged; this key can only be returned if upsert_strategy is SqlUtil::AbstractTable::UpsertSelectFirst, SqlUtil::AbstractTable::UpsertInsertOnly, or SqlUtil::AbstractTable::UpsertUpdateOnly"deleted"
: the number of rows deleted; this can only be returned if upsert option delete_others
is True
|
inlinestatic |
executes the upsert() method on the given datasource and table with the given input data and returns the result of the upsert operation
An implicit commit is made on the datasource if no persistent remote transaction is in progress and no errors occur executing the method; see Transaction Management with the sqlutil Service for more information on persistent remote transactions.
ds | the datasource name |
table | the table name |
row | a hash representing the row to insert or update |
upsert_strategy | see Upsert Strategy Codes for possible values for the upsert strategy |
opt | a hash of options for the upsert operation; see SqlUtil::AbstractTable::UpsertOptions for common options; each driver can support additional driver-specific options |