Qore jni Module
1.0.1
|
Java wrapper for the AbstractTable class in Qore. More...
Public Member Methods | |
AbstractTable (QoreObject obj) | |
creates the object as a wrapper for the Qore object | |
String | getName () throws Throwable |
returns the name of the table | |
String | getDesc () throws Throwable |
returns a descriptive string of the datasource (without the password) and the table name (with a possible qualifier for schema, etc) More... | |
String | getBaseType () throws Throwable |
returns the base type of the underlying object (normally "table", some DB-specific implementations may support others like "view" ) | |
String | getSqlName () throws Throwable |
returns the name of the table to be used in SQL (with a possible qualifier for schema, etc) | |
String | getColumnSqlName (String col) throws Throwable |
returns the column name for use in SQL strings; subclasses can return a special string in case the column name is a reserved word | |
void | commit () throws Throwable |
commits the current transaction on the underlying org.qore.lang.AbstractDatasource | |
void | rollback () throws Throwable |
rolls back the current transaction on the underlying org.qore.lang.AbstractDatasource | |
boolean | inDb () throws Throwable |
returns true if the table has been read from or created in the database, false if not More... | |
void | drop (HashMap< String, Object > opt) throws Throwable |
drops the table from the database without any transaction management More... | |
void | drop () throws Throwable |
drops the table from the database without any transaction management More... | |
Object | tryExec (String sql) throws Throwable |
executes some SQL with optional arguments so that if an error occurs the current transaction state is not lost More... | |
Object | tryExecArgs (String sql, Object[] args) throws Throwable |
executes some SQL with optional arguments so that if an error occurs the current transaction state is not lost More... | |
Object | tryExecRaw (String sql) throws Throwable |
executes some SQL so that if an error occurs the current transaction state is not lost More... | |
String [] | getDropSql (Map< String, Object > opt) throws Throwable |
returns the sql required to drop the table; reimplement in subclasses if necessary More... | |
String [] | getDropSql () throws Throwable |
returns the sql required to drop the table; reimplement in subclasses if necessary More... | |
void | truncate () throws Throwable |
truncates all the table data without any transaction management More... | |
String | getTruncateSql (Map< String, Object > opt) throws Throwable |
gets the SQL that can be used to truncate the table More... | |
String | getTruncateSql () throws Throwable |
gets the SQL that can be used to truncate the table More... | |
void | create (Map< String, Object > opt) throws Throwable |
creates the table with all associated properties (indexes, constraints, etc) without any transaction management More... | |
void | create () throws Throwable |
creates the table with all associated properties (indexes, constraints, etc) without any transaction management More... | |
boolean | emptyData () throws Throwable |
returns true if the table has no data rows, false if not More... | |
boolean | empty () throws Throwable |
returns true if the table has no definitions, false if not More... | |
void | setupTable (Map< String, Object > desc, Map< String, Object > opt) throws Throwable |
creates the object from a table description hash More... | |
void | setupTable (Map< String, Object > desc) throws Throwable |
creates the object from a table description hash More... | |
void | addColumn (String cname, Map< String, Object > opt, boolean nullable) throws Throwable |
adds a column to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example More... | |
void | addColumn (String cname, Map< String, Object > opt) throws Throwable |
adds a nullable column to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example More... | |
String [] | getAddColumnSql (String cname, Map< String, Object > copt, boolean nullable, Map< String, Object > opt) throws Throwable |
returns a list of SQL strings that can be use to add a column to the table More... | |
String [] | getAddColumnSql (String cname, Map< String, Object > copt, boolean nullable) throws Throwable |
returns a list of SQL strings that can be use to add a column to the table More... | |
String [] | getAddColumnSql (String cname, Map< String, Object > copt) throws Throwable |
returns a list of SQL strings that can be use to add a nullable column to the table More... | |
String [] | getModifyColumnSql (String cname, Map< String, Object > copt, boolean nullable, Map< String, Object > opt) throws Throwable |
gets a list of SQL strings that can be used to modify an existing column in the table More... | |
String [] | getModifyColumnSql (String cname, Map< String, Object > copt, boolean nullable) throws Throwable |
gets a list of SQL strings that can be used to modify an existing column in the table More... | |
String [] | getModifyColumnSql (String cname, Map< String, Object > copt) throws Throwable |
gets a list of SQL strings that can be used to modify an existing column in the table More... | |
String | getRenameColumnSql (String old_name, String new_name, Map< String, Object > opt) throws Throwable |
gets an SQL String that can be used to rename an existing column in the table More... | |
String | getRenameColumnSql (String old_name, String new_name) throws Throwable |
gets an SQL String that can be used to rename an existing column in the table More... | |
void | addPrimaryKey (String pkname, String[] columns, Map< String, Object > opt) throws Throwable |
adds a primary key to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example More... | |
void | addPrimaryKey (String pkname, String[] columns) throws Throwable |
adds a primary key to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example More... | |
String | getAddPrimaryKeySql (String pkname, String[] cols, Map< String, Object > pkopt, Map< String, Object > opt) throws Throwable |
returns the SQL that can be used to add a primary key to the table More... | |
String | getAddPrimaryKeySql (String pkname, String[] cols, Map< String, Object > pkopt) throws Throwable |
returns the SQL that can be used to add a primary key to the table More... | |
String | getAddPrimaryKeySql (String pkname, String[] cols) throws Throwable |
returns the SQL that can be used to add a primary key to the table More... | |
String [] | getDropAllConstraintsAndIndexesOnColumnSql (String cname, Map< String, Object > opt) throws Throwable |
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the column does not exist then an empty list is returned More... | |
String [] | getDropAllConstraintsAndIndexesOnColumnSql (String cname) throws Throwable |
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the column does not exist then an empty list is returned More... | |
String [] | getDropPrimaryKeySql (Map< String, Object > opt) throws Throwable |
gets a list of SQL strings that can be used to drop the primary key from the table More... | |
String [] | getDropPrimaryKeySql () throws Throwable |
gets a list of SQL strings that can be used to drop the primary key from the table More... | |
void | addUniqueConstraint (String cname, String[] cols, Map< String, Object > opt) throws Throwable |
adds a unique constraint to the table; if the table is known to be in the database already, then the constraint is added to the database also immediately; otherwise it is only added internally and can be created when create() is called for example More... | |
String | getAddUniqueConstraintSql (String cname, String[] cols, Map< String, Object > ukopt, Map< String, Object > opt) throws Throwable |
returns an SQL String that can be used to add a unique constraint to the table More... | |
String | getAddUniqueConstraintSql (String cname, String[] cols, Map< String, Object > ukopt) throws Throwable |
returns an SQL String that can be used to add a unique constraint to the table More... | |
String | getAddUniqueConstraintSql (String cname, String[] cols) throws Throwable |
returns an SQL String that can be used to add a unique constraint to the table More... | |
void | addIndex (String iname, boolean unique, String[] cols, Map< String, Object > opt) throws Throwable |
adds an index to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example More... | |
void | addIndex (String iname, boolean unique, String[] cols) throws Throwable |
adds an index to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example More... | |
String | getAddIndexSql (String iname, boolean unique, String[] cols, Map< String, Object > ixopt, Map< String, Object > opt) throws Throwable |
returns an SQL String that can be used to add an index to the table More... | |
String | getAddIndexSql (String iname, boolean unique, String[] cols, Map< String, Object > ixopt) throws Throwable |
returns an SQL String that can be used to add an index to the table More... | |
String | getAddIndexSql (String iname, boolean unique, String[] cols) throws Throwable |
returns an SQL String that can be used to add an index to the table More... | |
String | getDropIndexSql (String iname, Map< String, Object > opt) throws Throwable |
gets the SQL that can be used to drop an index from the table More... | |
String | getDropIndexSql (String iname) throws Throwable |
gets the SQL that can be used to drop an index from the table More... | |
String | getAddForeignConstraintSql (String cname, String[] cols, String table, String[] tcols, Map< String, Object > fkopt, Map< String, Object > opt) throws Throwable |
returns an SQL String that can be used to add a foreign constraint to the table More... | |
String | getAddForeignConstraintSql (String cname, String[] cols, String table, String[] tcols, Map< String, Object > fkopt) throws Throwable |
returns an SQL String that can be used to add a foreign constraint to the table More... | |
String | getAddForeignConstraintSql (String cname, String[] cols, String table, String[] tcols) throws Throwable |
returns an SQL String that can be used to add a foreign constraint to the table More... | |
String | getAddForeignConstraintSql (String cname, String[] cols, String table) throws Throwable |
returns an SQL String that can be used to add a foreign constraint to the table More... | |
String | getAddCheckConstraintSql (String cname, String src, Map< String, Object > copt, Map< String, Object > opt) throws Throwable |
returns an SQL String that can be used to add a check constraint to the table More... | |
String | getAddCheckConstraintSql (String cname, String src, Map< String, Object > copt) throws Throwable |
returns an SQL String that can be used to add a check constraint to the table More... | |
String | getAddCheckConstraintSql (String cname, String src) throws Throwable |
returns an SQL String that can be used to add a check constraint to the table More... | |
String | getDropConstraintSql (String cname, Map< String, Object > opt) throws Throwable |
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint More... | |
String | getDropConstraintSql (String cname) throws Throwable |
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint More... | |
String | getDropConstraintIfExistsSql (String cname, Map< String, Object > opt) throws Throwable |
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns null; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint More... | |
String | getDropConstraintIfExistsSql (String cname) throws Throwable |
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns null; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint More... | |
String [] | getAddTriggerSql (String tname, String src, Map< String, Object > topt, Map< String, Object > opt) throws Throwable |
returns a list of SQL strings that can be used to add a trigger to the table More... | |
String [] | getAddTriggerSql (String tname, String src, Map< String, Object > topt) throws Throwable |
returns a list of SQL strings that can be used to add a trigger to the table More... | |
String [] | getAddTriggerSql (String tname, String src) throws Throwable |
returns a list of SQL strings that can be used to add a trigger to the table More... | |
String [] | getDropTriggerSql (String tname, Map< String, Object > opt) throws Throwable |
returns SQL that can be used to drop the given trigger from the table More... | |
String [] | getDropTriggerSql (String tname) throws Throwable |
returns SQL that can be used to drop the given trigger from the table More... | |
String [] | getDropColumnSql (String cname, Map< String, Object > opt) throws Throwable |
returns the SQL that can be used to drop a column from the table More... | |
String [] | getDropColumnSql (String cname) throws Throwable |
returns the SQL that can be used to drop a column from the table More... | |
HashMap< String, Object > | insert (Map< String, Object > row) throws Throwable |
inserts a row into the table without any transaction management; a transaction will be in progress after this method is successfully executed More... | |
HashMap< String, Object > | insert (Map< String, Object > row, Map< String, Object > opt) throws Throwable |
insert() variant More... | |
boolean | hasReturning () throws Throwable |
returns true if the current database driver supports the "returning" clause in insert statements, false if not More... | |
int | insertFromSelect (String[] cols, AbstractTable source, Map< String, Object > sh, Map< String, Object > opt) throws Throwable |
inserts rows into a table based on a select statement from another table (which must be using the same datasource as the current table); a transaction will be in progress after this method is successfully executed More... | |
int | insertFromSelect (String[] cols, AbstractTable source, Map< String, Object > sh) throws Throwable |
insertFromSelect() variant | |
int | insertFromSelect (String[] cols, AbstractTable source) throws Throwable |
insertFromSelect() variant | |
int | upsert (Map< String, Object > row, int upsert_strategy, Map< String, Object > opt) throws Throwable |
update or insert the data in the table according to the hash argument; the table must have a unique key to do this More... | |
int | upsert (Map< String, Object > row, int upsert_strategy) throws Throwable |
update or insert the data in the table according to the hash argument; the table must have a unique key to do this More... | |
HashMap< String, Object > | upsertFromSelect (AbstractTable t, Map< String, Object > sh, int upsert_strategy, Map< String, Object > opt) throws Throwable |
this method upserts or merges data from the given foreign table and select option hash into the current table; no transaction management is performed with this method More... | |
HashMap< String, Object > | upsertFromSelect (AbstractTable t, Map< String, Object > sh, int upsert_strategy) throws Throwable |
this method upserts or merges data from the given foreign table and select option hash into the current table; no transaction management is performed with this method More... | |
int | del (HashMap< String, Object > cond, HashMap< String, Object > opt) throws Throwable |
deletes rows in the table matching the condition and returns the count of rows deleted; no transaction management is performed with this method More... | |
int | del (HashMap< String, Object > cond) throws Throwable |
del() variant | |
int | del () throws Throwable |
del() variant | |
int | update (HashMap< String, Object > set, HashMap< String, Object > cond, HashMap< String, Object > opt) throws Throwable |
updates rows in the table matching an optional condition and returns the count of rows updated; no transaction management is performed with this method More... | |
int | update (HashMap< String, Object > set, HashMap< String, Object > cond) throws Throwable |
A update() variant. | |
int | update (HashMap< String, Object > set) throws Throwable |
A update() variant. | |
HashMap< String, Object > | upsertFromSelect (AbstractTable t, Map< String, Object > sh) throws Throwable |
this method upserts or merges data from the given foreign table and select option hash into the current table; no transaction management is performed with this method More... | |
int | rowCount () throws Throwable |
returns the number of rows in the table More... | |
AbstractSQLStatement | getStatement (Map< String, Object > sh, Map< String, Object > opt) throws Throwable |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments More... | |
AbstractSQLStatement | getStatement (Map< String, Object > sh) throws Throwable |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments More... | |
AbstractSQLStatement | getStatement () throws Throwable |
returns an AbstractSQLStatement object that will iterate all the rows in the table More... | |
AbstractSQLStatement | getStatementNoExec (Map< String, Object > sh, Map< String, Object > opt) throws Throwable |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments; the statement is only prepared and not executed More... | |
AbstractSQLStatement | getStatementNoExec (Map< String, Object > sh) throws Throwable |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments; the statement is only prepared and not executed More... | |
AbstractSQLStatement | getStatementNoExec () throws Throwable |
returns an AbstractSQLStatement object that will iterate all the rows in the table; the statement is only prepared and not executed More... | |
HashMap< String, Object > | selectRow (Map< String, Object > sh, Map< String, Object > opt) throws Throwable |
returns a hash representing the row in the table that matches the argument hash; if more than one row would be returned an exception is raised More... | |
HashMap< String, Object > | selectRow (Map< String, Object > sh) throws Throwable |
returns a hash representing the row in the table that matches the argument hash; if more than one row would be returned an exception is raised More... | |
HashMap< String, Object > [] | selectRows (Map< String, Object > sh, Map< String, Object > opt) throws Throwable |
returns a list of hashes representing the rows in the table that match the argument hash More... | |
HashMap< String, Object > [] | selectRows (Map< String, Object > sh) throws Throwable |
returns a list of hashes representing the rows in the table that match the argument hash More... | |
HashMap< String, Object > [] | selectRows () throws Throwable |
returns a list of hashes representing the rows in the table that match the argument hash More... | |
HashMap< String, Object > | select (Map< String, Object > sh, Map< String, Object > opt) throws Throwable |
returns a hash of lists representing the columns and rows in the table that match the argument hahs More... | |
HashMap< String, Object > | select (Map< String, Object > sh) throws Throwable |
returns a hash of lists representing the columns and rows in the table that match the argument hahs More... | |
HashMap< String, Object > | select () throws Throwable |
returns a hash of lists representing the columns and rows in the table that match the argument hahs More... | |
Public Member Methods inherited from org.qore.lang.sqlutil.AbstractSqlUtilBase | |
AbstractSqlUtilBase (QoreObject obj) | |
creates the object from a weak reference to the Qore object | |
AbstractDatasource | getDatasource () throws Throwable |
gets the underlying AbstractDatasource | |
String | getDriverName () throws Throwable |
returns the database driver name | |
String | getDatasourceDesc () throws Throwable |
returns a descriptive string for the datasource | |
Public Member Methods inherited from org.qore.jni.QoreObjectWrapper | |
QoreObjectWrapper (QoreObject obj) | |
creates the wrapper object with the Qore object | |
void | release () |
releases the Qore object; do not call any further methods on the object after this call | |
QoreObject | getQoreObject () |
returns the Qore object | |
String | className () |
returns the class name for the Qore object | |
boolean | instanceOf (String class_name) |
returns true if the object is an instance of the given class | |
Static Public Member Methods | |
static HashMap< String, Object > | make_cop (String cop, Object column, Object arg) throws Throwable |
returns a ColumnOperatorInfo hash More... | |
static HashMap< String, Object > | make_cop (String cop, Object column) throws Throwable |
returns a ColumnOperatorInfo hash More... | |
static HashMap< String, Object > | cop_as (Object column, String arg) throws Throwable |
returns a ColumnOperatorInfo hash for the "as" operator with the given argument More... | |
static HashMap< String, Object > | cop_cast (Object column, String arg, Object arg1, Object arg2) throws Throwable |
returns a ColumnOperatorInfo hash for the "cast" operator with the given argument(s) More... | |
static HashMap< String, Object > | cop_cast (Object column, String arg, Object arg1) throws Throwable |
returns a ColumnOperatorInfo hash for the "cast" operator with the given argument(s) More... | |
static HashMap< String, Object > | cop_cast (Object column, String arg) throws Throwable |
returns a ColumnOperatorInfo hash for the "cast" operator with the given argument(s) More... | |
static HashMap< String, Object > | cop_prepend (Object column, String arg) throws Throwable |
returns a ColumnOperatorInfo hash for the "prepend" operator with the given argument More... | |
static HashMap< String, Object > | cop_append (Object column, String arg) throws Throwable |
returns a ColumnOperatorInfo hash for the "append" operator with the given argument More... | |
static HashMap< String, Object > | cop_value (Object arg) throws Throwable |
returns a ColumnOperatorInfo hash for the "value" (literal) operator with the given argument More... | |
static HashMap< String, Object > | cop_upper (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "upper" operator with the given argument; returns a column value in upper case More... | |
static HashMap< String, Object > | cop_lower (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "lower" operator with the given argument; returns a column value in lower case More... | |
static HashMap< String, Object > | cop_distinct (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "distinct" operator with the given argument; returns distinct column values More... | |
static HashMap< String, Object > | cop_min (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "min" operator; returns minimum column values More... | |
static HashMap< String, Object > | cop_max (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "max" operator; returns maximum column values More... | |
static HashMap< String, Object > | cop_avg (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "avg" operator; returns average column values More... | |
static HashMap< String, Object > | cop_sum (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "sum" operator; returns the total sum of a numeric column. More... | |
static HashMap< String, Object > | cop_count (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts More... | |
static HashMap< String, Object > | cop_count () throws Throwable |
returns a ColumnOperatorInfo hash for the "count" operator; returns row counts More... | |
static HashMap< String, Object > | cop_over (Object column, String partitionby, String orderby) throws Throwable |
returns a ColumnOperatorInfo hash for the "over" clause More... | |
static HashMap< String, Object > | cop_over (Object column, String partitionby) throws Throwable |
returns a ColumnOperatorInfo hash for the "over" clause More... | |
static HashMap< String, Object > | cop_over (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "over" clause More... | |
static HashMap< String, Object > | cop_minus (Object column1, Object column2) throws Throwable |
returns a ColumnOperatorInfo hash for the "-" operator with the given arguments More... | |
static HashMap< String, Object > | cop_plus (Object column1, Object column2) throws Throwable |
returns a ColumnOperatorInfo hash for the "+" operator with the given arguments More... | |
static HashMap< String, Object > | cop_divide (Object column1, Object column2) throws Throwable |
returns a ColumnOperatorInfo hash for the "/" operator with the given arguments More... | |
static HashMap< String, Object > | cop_multiply (Object column1, Object column2) throws Throwable |
returns a ColumnOperatorInfo hash for the "*" operator with the given arguments More... | |
static HashMap< String, Object > | cop_year (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "year" operator with the given argument More... | |
static HashMap< String, Object > | cop_year_month (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "year_month" operator with the given argument More... | |
static HashMap< String, Object > | cop_year_day (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "year_day" operator with the given argument More... | |
static HashMap< String, Object > | cop_year_hour (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "year_hour" operator with the given argument More... | |
static HashMap< String, Object > | cop_seq (String seq, String as) throws Throwable |
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence name whose value should be returned More... | |
static HashMap< String, Object > | cop_seq (String seq) throws Throwable |
returns a ColumnOperatorInfo hash for the "seq" operator with the given argument giving the sequence name whose value should be returned More... | |
static HashMap< String, Object > | cop_seq_currval (String seq, String as) throws Throwable |
returns a ColumnOperatorInfo hash for the "seq_currval" operator with the given argument giving the sequence name whose current value should be returned More... | |
static HashMap< String, Object > | cop_seq_currval (String seq) throws Throwable |
returns a ColumnOperatorInfo hash for the "seq_currval" operator with the given argument giving the sequence name whose current value should be returned More... | |
static HashMap< String, Object > | cop_coalesce (Object col1, Object col2) throws Throwable |
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the first non-NULL column value will be returned More... | |
static HashMap< String, Object > | cop_coalesce (Object col1, Object col2, Object... args) throws Throwable |
returns a ColumnOperatorInfo hash for the "coalesce" operator with the given column arguments; the first non-NULL column value will be returned More... | |
static HashMap< String, Object > | cop_substr (Object column, int start, int count) throws Throwable |
returns a ColumnOperatorInfo hash for the "substr" operator with the given arguments; returns a substring of a column value More... | |
static HashMap< String, Object > | cop_substr (Object column, int start) throws Throwable |
returns a ColumnOperatorInfo hash for the "substr" operator with the given arguments; returns a substring of a column value More... | |
static HashMap< String, Object > | cop_length (Object column) throws Throwable |
returns a ColumnOperatorInfo hash for the "len" operator with the given argument; returns the length of the given text field More... | |
static HashMap< String, Object > | cop_trunc_date (Object column, String mask) throws Throwable |
Truncates a date column or value regarding the given mask. The resulting value remains Qore::date (no conversion to eg. string) More... | |
static HashMap< String, Object > | cop_cume_dist () throws Throwable |
Analytic/window method: relative rank of the current row. More... | |
static HashMap< String, Object > | cop_dense_rank () throws Throwable |
Analytic/window method: rank of the current row without gaps. More... | |
static HashMap< String, Object > | cop_first_value (Object column) throws Throwable |
Analytic/window method: value evaluated at the row that is the first row of the window frame. More... | |
static HashMap< String, Object > | cop_last_value (Object column) throws Throwable |
Analytic/window method: value evaluated at the row that is the last row of the window frame. More... | |
static HashMap< String, Object > | cop_ntile (int value) throws Throwable |
Analytic/window method: integer ranging from 1 to the argument value, dividing the partition as equally as possible. More... | |
static HashMap< String, Object > | cop_percent_rank () throws Throwable |
Analytic/window method: relative rank of the current row. More... | |
static HashMap< String, Object > | cop_rank () throws Throwable |
Analytic/window method: rank of the current row with gaps. More... | |
static HashMap< String, Object > | cop_row_number () throws Throwable |
Analytic/window method: number of the current row within its partition, counting from 1. More... | |
Static Public Attributes | |
static int | UpsertInsertFirst = 1 |
Upsert option: insert first, if the insert fails, then update. More... | |
static int | UpsertUpdateFirst = 2 |
Upsert option: update first, if the update fails, then insert. More... | |
static int | UpsertSelectFirst = 3 |
Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist, insert, otherwise update. More... | |
static int | UpsertAuto = 4 |
Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst. More... | |
static int | UpsertInsertOnly = 5 |
Upsert option: insert if the row does not exist, otherwise ignore. More... | |
static int | UpsertUpdateOnly = 6 |
Upsert option: update if the row exists, otherwise ignore. More... | |
static final Map< Integer, String > | UpsertStrategyMap |
hash mapping upsert strategy codes to a text description More... | |
static final Map< String, Integer > | UpsertStrategyDescriptionMap |
hash mapping upsert strategy descriptions to upsert strategy codes More... | |
static final String | DT_YEAR = "Y" |
Format unit: year. | |
static final String | DT_MONTH = "M" |
Format unit: month. | |
static final String | DT_DAY = "D" |
Format unit: day. | |
static final String | DT_HOUR = "H" |
Format unit: hour. | |
static final String | DT_MINUTE = "m" |
Format unit: minute. | |
static final String | DT_SECOND = "S" |
Format unit: hour. | |
static int | UR_Inserted = 1 |
row was inserted | |
static int | UR_Verified = 2 |
row was updated unconditionally (not returned with UpsertSelectFirst) | |
static int | UR_Updated = 3 |
row was updated because it was different (only possible with UpsertSelectFirst) | |
static int | UR_Unchanged = 4 |
row was unchanged (only possible with UpsertSelectFirst, UpsertInsertOnly, and UpsertUpdateOnly) | |
static int | UR_Deleted = 5 |
row was deleted (only possible with batch upsert methods such as upsertFromIterator() where upsert option delete_others is true) | |
static final Map< Integer, String > | UpsertResultMap |
hash mapping upsert results to a description More... | |
static final Map< String, Integer > | UpsertResultDescriptionMap |
hash mapping upsert descriptions to codes More... | |
static final Map< Integer, String > | UpsertResultLetterMap |
maps upsert result codes to single letter symbols | |
Additional Inherited Members | |
Private Attributes inherited from org.qore.jni.QoreObjectWrapper | |
QoreObject | obj |
the wrapper Qore object | |
Java wrapper for the AbstractTable class in Qore.
The following keys can be set for this option:
info_callback:
see info_callbacksql_callback:
see sql_callbacksql_callback_executed:
see sql_callback_executedThis option is comprised of Callback Options plus the following keys:
replace:
(coolean) if true and supported by the underlying db driver, "create or replace"
text is used when creating objectstable_cache:
(Tables) an optional table cache for maintaining cached tables and foreign key relationships between tablesdata_tablespace:
(String) a string giving the data tablespace to use for tablesindex_tablespace:
(String) a string giving the index tablespace to use for indexesindex_tablespace:
(String) a string giving the index tablespace to use for indexesreplace:
(boolean) if true and supported by the underlying db driver "create or replace" text is used when creating objectscurrently this option is a combination of Index Options and Creation Options plus the following:
omit:
a list pf attributes to omit; possible values are: indexes
, foreign_constraints
, triggers
Currently this option is a combination of Table Creation Options and the following options:
column_map:
(Map) a hash for automatically renaming columns; if the source name (key) exists and the target name (value) does not exist, then the source column is automatically renamedindex_map:
(Map) a hash for automatically renaming indexes; if the source name (key) exists and the target name (value) does not exist, then the source index is automatically renamedconstraint_map:
(Map) a hash for automatically renaming constraints; if the source name (key) exists and the target name (value) does not exist, then the source constraint is automatically renamedtrigger_map:
(Map) a hash for automatically renaming triggers; if the source name (key) exists and the target name (value) does not exist, then the source trigger is automatically renameddb_table_cache:
(Tables) an optional table cache for maintaining tables in the database and foreign key relationships between tablesforce:
(boolean) if true and supported by the driver and object, any objects dropped will be dropped with FORCE
or CASCADE
optionsIn addition to any SqlDataCallbackOptions, the following keys can be set for this option:
returning:
a list having elements of one of the two following types:"key"
: (required) the column name to return"type"
: (optional) the data type for the output placeholder buffer (ex: number)"returning"
with a database that does not support this clause will cause an exception to be thrown; see AbstractTable.hasReturning()The following keys can be set for upsert options:
commit_block:
the number of changes made before an automatic commit is made for upsert methods that perform commitsdelete_others:
if this option is true, then a hash of primary key values in the input data is built as the input data is iterated. After iterating, if the row count of the table and the input data matches, then nothing more is done, otherwise, every row of the table is iterated and compared to the primary key hash; if a row does not match a primary key value, then it is deleted. This operation allows tables to be completely synchronized by removing rows in the target table not present in the source table. This operation is expensive for large data sets.info_callback:
see upsert_info_callbackomit_update:
allows for an asymmetrical upsert where a set of column values is inserted, but a smaller set is updated in case the unique key values are present in the target table; the value of this key should be set to the columns to omit in the update clause
|
inline |
adds a column to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the column |
opt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
nullable | if true then the column can hold NULL values; note that primary key columns cannot be nullable |
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column already exists, invalid column data |
default_value
value when adding a column with a "not null"
constraint with existing data
|
inline |
adds a nullable column to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the column |
opt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column already exists, invalid column data |
default_value
value when adding a column with a "not null"
constraint with existing data
|
inline |
adds an index to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
iname | the name of the new index |
unique | a flag to tell if the new index should be unique or not |
cols | a single column name or a list of columns that make up the index |
opt | a hash of options for the new index; each driver may implement its own options; for common options, see AbstractTable::IndexOptions |
INDEX-ERROR | the table already has an index with the given name or invalid columns or options were passed |
|
inline |
adds an index to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
iname | the name of the new index |
unique | a flag to tell if the new index should be unique or not |
cols | a single column name or a list of columns that make up the index |
INDEX-ERROR | the table already has an index with the given name or invalid columns or options were passed |
|
inline |
adds a primary key to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
pkname | the name of the new primary key constraint |
columns | a single column name or a list of columns that make up the primary key |
opt | a hash of options for the new primary key; each driver may implement its own options; for common options, see AbstractTable::ConstraintOptions |
PRIMARY-KEY-ERROR | the table already has a primary key or invalid columns or options passed |
|
inline |
adds a primary key to the table; if the table is already known to be in the database, then it is added in the database also immediately; otherwise it is only added internally and can be created when create() is called for example
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
pkname | the name of the new primary key constraint |
columns | a single column name or a list of columns that make up the primary key |
PRIMARY-KEY-ERROR | the table already has a primary key or invalid columns or options passed |
|
inline |
adds a unique constraint to the table; if the table is known to be in the database already, then the constraint is added to the database also immediately; otherwise it is only added internally and can be created when create() is called for example
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the new unique constraint |
cols | a single column name or a list of columns that make up the unique constraint |
opt | a hash of options for the new unique constraint; each driver may implement its own options; for common options, see AbstractTable::ConstraintOptions |
UNIQUE-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns passed |
OPTION-ERROR | invalid or unsupported option passed |
|
inline |
creates the table with all associated properties (indexes, constraints, etc) without any transaction management
opt | a hash of options for the SQL creation strings |
CREATE-TABLE-ERROR | table has already been read from or created in the database |
|
inline |
creates the table with all associated properties (indexes, constraints, etc) without any transaction management
CREATE-TABLE-ERROR | table has already been read from or created in the database |
|
inline |
deletes rows in the table matching the condition and returns the count of rows deleted; no transaction management is performed with this method
cond | a hash of conditions for the where clause; see where_clauses for more information |
sql | an optional reference to a string to return the SQL generated for the select statement |
opt | optional SQL data operation callback options; see AbstractTable::SqlDataCallbackOptions for more info |
WHERE-ERROR | unknown operator or invalid arguments given in the cond hash for the where clause |
|
inline |
drops the table from the database without any transaction management
opt | optional callback options; see Callback Options for more info |
OPTION-ERROR | invalid or unknown callback option |
|
inline |
drops the table from the database without any transaction management
OPTION-ERROR | invalid or unknown callback option |
|
inline |
returns true if the table has no definitions, false if not
|
inline |
returns true if the table has no data rows, false if not
|
inline |
returns an SQL String that can be used to add a check constraint to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the new constraint |
src | the source of the constraint clause |
copt | a hash of options for the new constraint; each driver may implement its own options; for common options, see ConstraintOptions |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
CHECK-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add a check constraint to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the new constraint |
src | the source of the constraint clause |
copt | a hash of options for the new constraint; each driver may implement its own options; for common options, see ConstraintOptions |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
CHECK-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add a check constraint to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the new constraint |
src | the source of the constraint clause |
copt | a hash of options for the new constraint; each driver may implement its own options; for common options, see ConstraintOptions |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
CHECK-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns or options were passed |
|
inline |
returns a list of SQL strings that can be use to add a column to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the column |
copt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
nullable | if true then the column can hold NULL values; note that primary key columns cannot be nullable |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column already exists, invalid column data |
default_value
value when adding a column with a "not null"
constraint with existing data
|
inline |
returns a list of SQL strings that can be use to add a column to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the column |
copt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
nullable | if true then the column can hold NULL values; note that primary key columns cannot be nullable |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column already exists, invalid column data |
default_value
value when adding a column with a "not null"
constraint with existing data
|
inline |
returns a list of SQL strings that can be use to add a nullable column to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
cname | the name of the column |
copt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column already exists, invalid column data |
default_value
value when adding a column with a "not null"
constraint with existing data
|
inline |
returns an SQL String that can be used to add a foreign constraint to the table
cname | the name of the new foreign constraint |
cols | a single column name or a list of columns in the local table that make up the foreign constraint |
table | the name of the other table that the constraint targets |
tcols | a single column name or a list of columns in the foreign table or null meaning that the column names are the same as in the local table; if column names are given the same number of columns must be given in the local and foreign tables |
fkopt | a hash of options for the new foreign constraint; each driver may implement its own options; for common options, see ForeignConstraintOptions |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
FOREIGN-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add a foreign constraint to the table
cname | the name of the new foreign constraint |
cols | a single column name or a list of columns in the local table that make up the foreign constraint |
table | the name of the other table that the constraint targets |
tcols | a single column name or a list of columns in the foreign table or null meaning that the column names are the same as in the local table; if column names are given the same number of columns must be given in the local and foreign tables |
fkopt | a hash of options for the new foreign constraint; each driver may implement its own options; for common options, see ForeignConstraintOptions |
OPTION-ERROR | invalid or unsupported option passed |
FOREIGN-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add a foreign constraint to the table
cname | the name of the new foreign constraint |
cols | a single column name or a list of columns in the local table that make up the foreign constraint |
table | the name of the other table that the constraint targets |
tcols | a single column name or a list of columns in the foreign table or null meaning that the column names are the same as in the local table; if column names are given the same number of columns must be given in the local and foreign tables |
OPTION-ERROR | invalid or unsupported option passed |
FOREIGN-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add a foreign constraint to the table
cname | the name of the new foreign constraint |
cols | a single column name or a list of columns in the local table that make up the foreign constraint |
table | the name of the other table that the constraint targets |
OPTION-ERROR | invalid or unsupported option passed |
FOREIGN-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add an index to the table
iname | the name of the new index |
unique | a flag to tell if the new index should be unique or not |
cols | a single column name or a list of columns that make up the index |
ixopt | a hash of options for the new index; each driver may implement its own options; for common options, see Index Options |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
INDEX-ERROR | the table already has an index with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add an index to the table
iname | the name of the new index |
unique | a flag to tell if the new index should be unique or not |
cols | a single column name or a list of columns that make up the index |
ixopt | a hash of options for the new index; each driver may implement its own options; for common options, see Index Options |
OPTION-ERROR | invalid or unsupported option passed |
INDEX-ERROR | the table already has an index with the given name or invalid columns or options were passed |
|
inline |
returns an SQL String that can be used to add an index to the table
iname | the name of the new index |
unique | a flag to tell if the new index should be unique or not |
cols | a single column name or a list of columns that make up the index |
OPTION-ERROR | invalid or unsupported option passed |
INDEX-ERROR | the table already has an index with the given name or invalid columns or options were passed |
|
inline |
returns the SQL that can be used to add a primary key to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
pkname | the name of the new primary key constraint |
cols | a single column name or a list of columns that make up the primary key |
pkopt | a hash of options for the new primary key; each driver may implement its own options; for common options, see org.qore.sqlutil.AbstractTableConstraintOptions |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
PRIMARY-KEY-ERROR | the table already has a primary key or invalid columns or options passed |
|
inline |
returns the SQL that can be used to add a primary key to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
pkname | the name of the new primary key constraint |
cols | a single column name or a list of columns that make up the primary key |
pkopt | a hash of options for the new primary key; each driver may implement its own options; for common options, see ConstraintOptions |
OPTION-ERROR | invalid or unsupported option passed |
PRIMARY-KEY-ERROR | the table already has a primary key or invalid columns or options passed |
|
inline |
returns the SQL that can be used to add a primary key to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
pkname | the name of the new primary key constraint |
cols | a single column name or a list of columns that make up the primary key |
OPTION-ERROR | invalid or unsupported option passed |
PRIMARY-KEY-ERROR | the table already has a primary key or invalid columns or options passed |
|
inline |
returns a list of SQL strings that can be used to add a trigger to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
tname | the name of the new trigger |
src | the source of the trigger |
topt | a hash of options for the new trigger; each driver may implement its own options; for common options, see TriggerOptions |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
TRIGGER-ERROR | the table already has a trigger with the given name or invalid options were passed |
|
inline |
returns a list of SQL strings that can be used to add a trigger to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
tname | the name of the new trigger |
src | the source of the trigger |
topt | a hash of options for the new trigger; each driver may implement its own options; for common options, see TriggerOptions |
OPTION-ERROR | invalid or unsupported option passed |
TRIGGER-ERROR | the table already has a trigger with the given name or invalid options were passed |
|
inline |
returns a list of SQL strings that can be used to add a trigger to the table
In case the table is already in the database, this method commits the transaction on success and rolls back the transaction if there's an error.
tname | the name of the new trigger |
src | the source of the trigger |
OPTION-ERROR | invalid or unsupported option passed |
TRIGGER-ERROR | the table already has a trigger with the given name or invalid options were passed |
|
inline |
returns an SQL String that can be used to add a unique constraint to the table
cname | the name of the new unique constraint |
cols | a single column name or a list of columns that make up the unique constraint |
ukopt | a hash of options for the new unique constraint; each driver may implement its own options; for common options, see ConstraintOptions |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
UNIQUE-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns passed |
|
inline |
returns an SQL String that can be used to add a unique constraint to the table
cname | the name of the new unique constraint |
cols | a single column name or a list of columns that make up the unique constraint |
ukopt | a hash of options for the new unique constraint; each driver may implement its own options; for common options, see ConstraintOptions |
OPTION-ERROR | invalid or unsupported option passed |
UNIQUE-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns passed |
|
inline |
returns an SQL String that can be used to add a unique constraint to the table
cname | the name of the new unique constraint |
cols | a single column name or a list of columns that make up the unique constraint |
OPTION-ERROR | invalid or unsupported option passed |
UNIQUE-CONSTRAINT-ERROR | the table already has a constraint with the given name or invalid columns passed |
|
inline |
returns a descriptive string of the datasource (without the password) and the table name (with a possible qualifier for schema, etc)
Used in exception descriptions
|
inline |
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the column does not exist then an empty list is returned
cname | the name of the column |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
|
inline |
gets a list of SQL strings to drop all constraints and indexes with the given column name; if the column does not exist then an empty list is returned
cname | the name of the column |
OPTION-ERROR | invalid or unsupported option passed |
|
inline |
returns the SQL that can be used to drop a column from the table
cname | the name of the column to drop |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | the named column is not present in the table |
|
inline |
returns the SQL that can be used to drop a column from the table
cname | the name of the column to drop |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | the named column is not present in the table |
|
inline |
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns null; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint
cname | the name of the constraint to drop |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
|
inline |
gets the SQL that can be used to drop a constraint from the table if it exists, otherwise returns null; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint
cname | the name of the constraint to drop |
OPTION-ERROR | invalid or unsupported option passed |
|
inline |
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint
cname | the name of the constraint to drop |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
CONSTRAINT-ERROR | the given constraint does not exist in the table |
|
inline |
gets the SQL that can be used to drop a constraint from the table; this can be any constraint on the table, a primary key, a foreign key constraint, or a generic constraint
cname | the name of the constraint to drop |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
CONSTRAINT-ERROR | the given constraint does not exist in the table |
|
inline |
gets the SQL that can be used to drop an index from the table
iname | the name of the index to drop |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
INDEX-ERROR | the given index does not exist in the table |
|
inline |
gets the SQL that can be used to drop an index from the table
iname | the name of the index to drop |
OPTION-ERROR | invalid or unsupported option passed |
INDEX-ERROR | the given index does not exist in the table |
|
inline |
gets a list of SQL strings that can be used to drop the primary key from the table
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
PRIMARY-KEY-ERROR | the table has no primary key |
|
inline |
gets a list of SQL strings that can be used to drop the primary key from the table
OPTION-ERROR | invalid or unsupported option passed |
PRIMARY-KEY-ERROR | the table has no primary key |
|
inline |
returns the sql required to drop the table; reimplement in subclasses if necessary
opt | optional callback options; see Callback Options for more info |
OPTION-ERROR | invalid or unknown callback option |
|
inline |
returns the sql required to drop the table; reimplement in subclasses if necessary
OPTION-ERROR | invalid or unknown callback option |
|
inline |
returns SQL that can be used to drop the given trigger from the table
tname | the name of the trigger to drop |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
TRIGGER-ERROR | the given trigger does not exist |
|
inline |
returns SQL that can be used to drop the given trigger from the table
tname | the name of the trigger to drop |
OPTION-ERROR | invalid or unsupported option passed |
TRIGGER-ERROR | the given trigger does not exist |
|
inline |
gets a list of SQL strings that can be used to modify an existing column in the table
cname | the name of the column |
copt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
nullable | if true then the column can hold NULL values; note that primary key columns cannot be nullable |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column does not exist, invalid column data |
default_value
value when modifying a column to have a "not null"
constraint with existing data
|
inline |
gets a list of SQL strings that can be used to modify an existing column in the table
cname | the name of the column |
copt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
nullable | if true then the column can hold NULL values; note that primary key columns cannot be nullable |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column does not exist, invalid column data |
default_value
value when modifying a column to have a "not null"
constraint with existing data
|
inline |
gets a list of SQL strings that can be used to modify an existing column in the table
cname | the name of the column |
copt | a hash describing the column; the following keys are permitted (other column options may be supported depending on the underlying AbstractTable implementation):
|
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | no native_type or qore_type keys in column option hash, column does not exist, invalid column data |
default_value
value when modifying a column to have a "not null"
constraint with existing data
|
inline |
gets an SQL String that can be used to rename an existing column in the table
old_name | the current name of the column |
new_name | the new name of the column |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | if the old column does not exist in the table or the new column already does |
|
inline |
gets an SQL String that can be used to rename an existing column in the table
old_name | the current name of the column |
new_name | the new name of the column |
opt | a hash of options for the SQL string; see Align Table Options for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
COLUMN-ERROR | if the old column does not exist in the table or the new column already does |
|
inline |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
opt | optional SQL data operation callback options; see SqlDataCallbackOptions for more info |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automatically
|
inline |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automatically
|
inline |
returns an AbstractSQLStatement object that will iterate all the rows in the table
|
inline |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments; the statement is only prepared and not executed
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
opt | optional SQL data operation callback options; see SqlDataCallbackOptions for more info |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automatically
|
inline |
returns an AbstractSQLStatement object that will iterate the results of a select statement matching the arguments; the statement is only prepared and not executed
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automatically
|
inline |
returns an AbstractSQLStatement object that will iterate all the rows in the table; the statement is only prepared and not executed
|
inline |
gets the SQL that can be used to truncate the table
opt | a hash of options for the SQL string; see AbstractTable.AlignTableOptions for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
|
inline |
gets the SQL that can be used to truncate the table
OPTION-ERROR | invalid or unsupported option passed |
|
inline |
returns true if the current database driver supports the "returning"
clause in insert statements, false if not
"returning"
clause in insert statements, false if not
|
inline |
returns true if the table has been read from or created in the database, false if not
|
inline |
inserts a row into the table without any transaction management; a transaction will be in progress after this method is successfully executed
row | a hash representing the row to insert; hash values can also be set with sql_iop_funcs to insert values based on SQL operations to be used directly in the insert statement |
"returning"
insert option is used, a hash of return values is returned, otherwise null is returnedCOLUMN-ERROR | an unknown column was referenced in the hash to be inserted |
|
inline |
insert() variant
row | a hash representing the row to insert; hash values can also be set with sql_iop_funcs to insert values based on SQL operations to be used directly in the insert statement |
opt | optional insert options; see Insert Options for more info |
|
inline |
inserts rows into a table based on a select statement from another table (which must be using the same datasource as the current table); a transaction will be in progress after this method is successfully executed
cols | the list of column names to use to insert in the current table |
source | the source table for the select statement |
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
opt | optional SQL data operation callback options; see SqlDataCallbackOptions for more inf |
OPTION-ERROR | invalid or unsupported option |
COLUMN-ERROR | unknown or invalid column in insert list |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
|
inline |
returns the number of rows in the table
|
inline |
returns a hash of lists representing the columns and rows in the table that match the argument hahs
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
opt | optional SQL data operation callback options; see SqlDataCallbackOptions for more info |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
returns a hash of lists representing the columns and rows in the table that match the argument hahs
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
returns a hash of lists representing the columns and rows in the table that match the argument hahs
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
returns a hash representing the row in the table that matches the argument hash; if more than one row would be returned an exception is raised
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
opt | optional SQL data operation callback options; see SqlDataCallbackOptions for more info |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
DBI-SELECT-ROW-ERROR | more than 1 row retrieved from the server |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
returns a hash representing the row in the table that matches the argument hash; if more than one row would be returned an exception is raised
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
DBI-SELECT-ROW-ERROR | more than 1 row retrieved from the server |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
returns a list of hashes representing the rows in the table that match the argument hash
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
opt | optional SQL data operation callback options; see SqlDataCallbackOptions for more info |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
returns a list of hashes representing the rows in the table that match the argument hash
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
returns a list of hashes representing the rows in the table that match the argument hash
OPTION-ERROR | invalid or unsupported select option |
SELECT-ERROR | 'offset' supplied without 'orderby' or 'limit' , 'orderby' with 'limit' and 'offset' does not match any unique constraint |
"offset"
is supplied and no "orderby"
is supplied, then if any primary key exists, the primary key columns will be used for the "orderby"
option automaticallyforupdate
select option is used, then after a successful select operation, the calling thread will own the thread transaction lock
|
inline |
creates the object from a table description hash
desc | a table description hash describing the table |
opt | an optional hash of options for the table creation string; see sqlutil.AbstractTableTableOptions for common options; each driver can support additional driver-specific options |
OPTION-ERROR | invalid or unsupported option passed |
DESCRIPTION-ERROR | invalid or unsupported description hash value passed |
|
inline |
creates the object from a table description hash
desc | a table description hash describing the table |
OPTION-ERROR | invalid or unsupported option passed |
DESCRIPTION-ERROR | invalid or unsupported description hash value passed |
|
inline |
truncates all the table data without any transaction management
|
inline |
executes some SQL with optional arguments so that if an error occurs the current transaction state is not lost
Include any arguments in the parameter list after the sql argument
sql | the SQL to execute |
|
inline |
executes some SQL with optional arguments so that if an error occurs the current transaction state is not lost
sql | the SQL to execute |
args | the bind / placeholder or other arguments corresponding to the SQL string |
|
inline |
executes some SQL so that if an error occurs the current transaction state is not lost
Include any arguments in the parameter list after the sql argument
sql | the SQL to execute |
|
inline |
updates rows in the table matching an optional condition and returns the count of rows updated; no transaction management is performed with this method
set | the hash of values to set, key values are column names, hash values are the values to assign to those columns or update operators (see sql_uop_funcs) |
cond | a hash of conditions for the where clause; see where_clauses for more information |
sql | an optional reference to a string to return the SQL generated for the select statement |
opt | optional SQL data operation callback options; see AbstractTable::SqlDataCallbackOptions for more info |
UPDATE-ERROR | the set hash is empty |
WHERE-ERROR | unknown operator or invalid arguments given in the cond hash for the where clause |
|
inline |
update or insert the data in the table according to the hash argument; the table must have a unique key to do this
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 Upsert Options for common options; each driver can support additional driver-specific options |
COLUMN-ERROR | an unknown column was referenced in the hash to be inserted |
UPSERT-ERROR | no primary key, unique constraint, or unique index for upsert; not all columns of the unique constraint/index are used in the upsert statement |
|
inline |
update or insert the data in the table according to the hash argument; the table must have a unique key to do this
row | a hash representing the row to insert or update |
upsert_strategy | see Upsert Strategy Codes for possible values for the upsert strategy |
COLUMN-ERROR | an unknown column was referenced in the hash to be inserted |
UPSERT-ERROR | no primary key, unique constraint, or unique index for upsert; not all columns of the unique constraint/index are used in the upsert statement |
|
inline |
this method upserts or merges data from the given foreign table and select option hash into the current table; no transaction management is performed with this method
The table argument does not need to be in the same database as the current table; it can also be in a different database server or a database server of a different type (you can use this method to upsert or merge data to or from any database supported by SqlUtil).
t | the table for the source data; this does not need to be in the same database as the target (the current table), nor does it need to be the same database type |
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
upsert_strategy | see Upsert Strategy Codes for possible values for the upsert strategy |
opt | a hash of options for the upsert operation; see Upsert Options for common options; each driver can support additional driver-specific options; note that this method ignores any "commit_block" option |
"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 UpsertSelectFirst instead of "updated"
"updated"
: the number of rows updated; note that this key is only returned if upsert_strategy is 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 UpsertSelectFirst, UpsertInsertOnly, or UpsertUpdateOnly"deleted"
: the number of rows deleted; this can only be returned if upsert option delete_others
is trueOPTION-ERROR | invalid or unsupported option |
COLUMN-ERROR | an unknown column was referenced in the hash to be inserted |
UPSERT-ERROR | no primary key, unique constraint, or unique index for upsert; not all columns of the unique constraint/index are used in the upsert statement |
delete_others
is true, then a hash of primary key values in the input data is built as the input data is iterated. After iterating, if the row count of the table and the input data matches, then nothing more is done, otherwise, every row of the table is iterated and compared to the primary key hash; if a row does not match a primary key value, then it is deleted. This operation is only executed if delete_others
is true and is expensive for large data sets.this method uses an AbstractSQLStatement object to pipeline the select data to the upsert code; to release the transaction lock acquired by the AbstractSQLStatement object, a commit() or rollback() action must be executed on the underlying datasource object as in the example above
|
inline |
this method upserts or merges data from the given foreign table and select option hash into the current table; no transaction management is performed with this method
The table argument does not need to be in the same database as the current table; it can also be in a different database server or a database server of a different type (you can use this method to upsert or merge data to or from any database supported by SqlUtil).
t | the table for the source data; this does not need to be in the same database as the target (the current table), nor does it need to be the same database type |
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
upsert_strategy | see Upsert Strategy Codes for possible values for the upsert strategy |
"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 UpsertSelectFirst instead of "updated"
"updated"
: the number of rows updated; note that this key is only returned if upsert_strategy is 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 UpsertSelectFirst, UpsertInsertOnly, or UpsertUpdateOnly"deleted"
: the number of rows deleted; this can only be returned if upsert option delete_others
is trueOPTION-ERROR | invalid or unsupported option |
COLUMN-ERROR | an unknown column was referenced in the hash to be inserted |
UPSERT-ERROR | no primary key, unique constraint, or unique index for upsert; not all columns of the unique constraint/index are used in the upsert statement |
delete_others
is true, then a hash of primary key values in the input data is built as the input data is iterated. After iterating, if the row count of the table and the input data matches, then nothing more is done, otherwise, every row of the table is iterated and compared to the primary key hash; if a row does not match a primary key value, then it is deleted. This operation is only executed if delete_others
is true and is expensive for large data sets.this method uses an AbstractSQLStatement object to pipeline the select data to the upsert code; to release the transaction lock acquired by the AbstractSQLStatement object, a commit() or rollback() action must be executed on the underlying datasource object as in the example above
|
inline |
this method upserts or merges data from the given foreign table and select option hash into the current table; no transaction management is performed with this method
The table argument does not need to be in the same database as the current table; it can also be in a different database server or a database server of a different type (you can use this method to upsert or merge data to or from any database supported by SqlUtil).
t | the table for the source data; this does not need to be in the same database as the target (the current table), nor does it need to be the same database type |
sh | a hash of conditions for the select statement; see select option hash for information about this argument |
"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 UpsertSelectFirst instead of "updated"
"updated"
: the number of rows updated; note that this key is only returned if upsert_strategy is 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 UpsertSelectFirst, UpsertInsertOnly, or UpsertUpdateOnly"deleted"
: the number of rows deleted; this can only be returned if upsert option delete_others
is trueOPTION-ERROR | invalid or unsupported option |
COLUMN-ERROR | an unknown column was referenced in the hash to be inserted |
UPSERT-ERROR | no primary key, unique constraint, or unique index for upsert; not all columns of the unique constraint/index are used in the upsert statement |
delete_others
is true, then a hash of primary key values in the input data is built as the input data is iterated. After iterating, if the row count of the table and the input data matches, then nothing more is done, otherwise, every row of the table is iterated and compared to the primary key hash; if a row does not match a primary key value, then it is deleted. This operation is only executed if delete_others
is true and is expensive for large data sets.this method uses an AbstractSQLStatement object to pipeline the select data to the upsert code; to release the transaction lock acquired by the AbstractSQLStatement object, a commit() or rollback() action must be executed on the underlying datasource object as in the example above
|
static |
hash mapping upsert descriptions to codes
|
static |
hash mapping upsert results to a description