All Classes Namespaces Functions Variables Groups Pages
PgsqlSqlUtil.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
// @file PgsqlSqlUtil.qm Qore user module for working with PostgreSQL SQL data
/* PgsqlSqlUtil.qm Copyright 2013 - 2014 Qore Technologies, sro
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// this module requires Qore 0.8.8 or better
// requires the SqlUtil module
// don't use "$" signs for variables and class members, assume local variable scope
// require type definitions everywhere
// enable all warnings
/* Version History
* 2013-10-04 v1.0: David Nichols <david@qore.org>
+ the initial version of the PgsqlSqlUtil module
*/
namespace PgsqlSqlUtil {
PgsqlTable get_table(AbstractDatasource nds, string nname, *hash opts);
PgsqlDatabase get_database(AbstractDatasource nds, *hash opts);
parse_schema_name(string nname, reference schema, reference name);
class PgsqlType {
public:
public :
string name;
string src;
public:
constructor(string n_name, string n_src);
list getTypeList();
list getModifySql(PgsqlType old, *hash opt);
string getCreateSql(*hash opt);
string getDropSql(*hash opt);
string getRenameSql(string new_name);
bool equal(PgsqlType type);
};
class PgsqlIndex : public SqlUtil::AbstractIndex {
public:
public :
*string tablespace;
public:
constructor(string n_name, bool n_unique, hash n_cols, *string n_tablespace);
string getCreateSql(string table_name, *hash opt);
private bool equalImpl(AbstractIndex ix);
string getRenameSql(string table_name, string new_name);
};
class PgsqlForeignConstraint : public SqlUtil::AbstractForeignConstraint {
public:
constructor(string n, Columns c, ForeignConstraintTarget t);
string getCreateSql(string table_name, *hash opt);
softlist getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opt);
};
class PgsqlCheckConstraint : public SqlUtil::AbstractCheckConstraint {
public:
constructor(string n, string n_src);
string getCreateSql(string table_name, *hash opt);
list getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opt);
};
class PgsqlColumn : public SqlUtil::AbstractColumn {
public:
public :
int byte_size;
public:
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs);
string getNativeTypeString();
list getCreateSql(AbstractTable t);
list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt);
string getRenameSql(AbstractTable t, string new_name);
private bool equalImpl(AbstractColumn c);
};
class PgsqlNumericColumn : public PgsqlColumn,public SqlUtil::NumericColumnInfo {
public:
constructor(string n, string nt, *string qt, int sz, bool nul, *string dv, *string cm, softint bs, softint n_scale);
string getNativeTypeString();
};
class PgsqlUniqueConstraintCommon : public SqlUtil::AbstractUniqueConstraint {
public:
private :
*string tablespace;
public:
constructor(*string ts);
bool setIndexBase(string ix);
clearIndex();
abstract AbstractIterator keyIterator();
getIndexSql(reference sql, string name, *hash opts);
};
class PgsqlUniqueConstraint : public SqlUtil::AbstractUniqueConstraint,public PgsqlUniqueConstraintCommon {
public:
private :
bool enabled;
public:
constructor(string n, hash n_cols, bool e = True, *string ts);
PgsqlColumn memberGate(string k);
string getCreateSql(string table_name, *hash opts);
list getRenameSql(string table_name, string new_name);
string getCreateSql(string name, string table_name, *hash opts);
};
class PgsqlPrimaryKey : public SqlUtil::AbstractPrimaryKey,public PgsqlUniqueConstraintCommon {
public:
constructor();
constructor(string n, *hash c, *string ts);
PgsqlColumn memberGate(string k);
string getCreateSql(string table_name, *hash opts);
softlist getRenameSql(string table_name, string new_name);
};
class PgsqlSequence : public SqlUtil::AbstractSequence {
public:
constructor(string n_name, number n_start = 1, number n_increment = 1, *softnumber n_end);
string getCreateSql(*hash opt);
string getRenameSql(string new_name);
};
class PgsqlView : public SqlUtil::AbstractView {
public:
public :
*string viewowner;
public:
constructor(string n_name, string n_src, *string n_schemaname,
*string n_viewowner)
;
string getCreateSql(*hash opt);
softlist getRenameSql(string new_name);
};
class PgsqlTrigger : public SqlUtil::AbstractTrigger {
public:
constructor(string n, string n_src);
softlist getCreateSql(string table_name, *hash opt);
softlist getDropSql(string table_name);
private bool equalImpl(AbstractFunctionBase t);
softlist getRenameSql(string table_name, string new_name);
};
class PgsqlFunction : public SqlUtil::AbstractFunction {
public:
public :
*string args;
public:
constructor(string n, string n_src, *string a);
softlist getCreateSql(*hash opt);
string getDropSql();
private bool equalImpl(AbstractFunctionBase t);
softlist getRenameSql(string new_name);
setName(string new_name);
};
class PgsqlTriggerFunction : public PgsqlFunction {
public:
public :
string trigger;
public:
constructor(string n, string n_src, string n_trigger);
};
class PgsqlDatabase : public SqlUtil::AbstractDatabase {
public:
public :
const PgsqlSchemaDescriptionOptions = AbstractDatabase::SchemaDescriptionOptions + (
"types": Type::Hash,
"type_map": Type::Hash,
);
const PGSQL_TempSavepoint = "qore_pgsql_tmp_savepoint";
public:
constructor(AbstractDatasource nds, *hash opts);
private list featuresImpl();
PgsqlType makeType(string name, string src, *hash opts);
*PgsqlType getType(string name);
private PgsqlSequence makeSequenceImpl(string name, number start = 1, number increment = 1, *softnumber end, *hash opts);
private *AbstractSequence getSequenceImpl(string name);
private *AbstractView getViewImpl(string name);
private PgsqlFunction makeFunctionImpl(string name, string src, *hash opts);
private PgsqlFunction makeProcedureImpl(string name, string src, *hash opts);
private *AbstractFunction getFunctionImpl(string name);
private AbstractFunction getProcedureImpl(string name);
static *string getFunctionArgs(string err, reference src);
static PgsqlFunction processFunction(hash row, bool native_case);
private list getDropSchemaSqlImpl(hash schema_hash, *hash opt);
private list getAlignSqlImpl(hash schema_hash, *hash opt);
private list listTablesImpl();
private list listFunctionsImpl();
private list listProceduresImpl();
private list listSequencesImpl();
private list listViewsImpl();
private string getCreateSqlImpl(list l);
static string getCreateSql(list l);
private hash getSchemaDescriptionOptions();
private softint getNextSequenceValueImpl(string name);
private bool supportsSequencesImpl();
private bool supportsTypesImpl();
private bool supportsPackagesImpl();
private any tryExecArgsImpl(string sql, *softlist args);
private any tryExecRawImpl(string sql, *softlist args);
static any tryExecArgs(AbstractDatasource ds, string sql, *softlist args);
static any tryExecRaw(AbstractDatasource ds, string sql);
};
class PgsqlTable : public SqlUtil::AbstractTable {
public:
public :
const PgsqlTypeMap = (
"numeric": ("qore": Type::Number, "size": SZ_NUM,),
"decimal": ("qore": Type::Number, "size": SZ_NUM,),
"money": ("qore": Type::Number,),
"smallint": ("qore": Type::Int,),
"integer": ("qore": Type::Int,),
"bigint": ("qore": Type::Int,),
"smallserial": ("qore": Type::Int,),
"serial": ("qore": Type::Int,),
"bigserial": ("qore": Type::Int,),
"real": ("qore": Type::Float,),
"double precision": ("qore": Type::Float,),
"oid": ("qore": Type::Number,),
"character": ("qore": Type::String, "size": SZ_MAND,),
"char": ("qore": Type::String, "size": SZ_MAND,),
"character varying": ("qore": Type::String, "size": SZ_MAND,),
"varchar": ("qore": Type::String, "size": SZ_MAND,),
"date": ("qore": Type::Date,),
"timestamp without time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6), "default_size": 6,),
"timestamp": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"timestamp with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"time without time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"time": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"time with time zone": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"interval": ("qore": Type::Date, "size": SZ_OPT, "size_range": (0, 6),"default_size": 6,),
"abstime": ("qore": Type::Date,),
"reltime": ("qore": Type::Date,),
"text": ("qore": Type::String,),
"bytea": ("qore": Type::Binary,),
"bit": ("qore": Type::Binary,),
"bit varying": ("qore": Type::Binary,),
"boolean": ("qore": Type::Boolean,),
"macaddr": ("qore": Type::String,),
"inet": ("qore": Type::String,),
"cidr": ("qore": Type::String,),
);
const PgsqlNameMap = (
"character varying": "varchar",
"character": "char",
"timestamp without time zone": "timestamp",
"time without time zone": "time",
);
const QoreTypeMap = (
"integer": "bigint",
"float": "double precision",
"number": "numeric",
"string": "varchar",
"date": "timestamp",
"binary": "bytea",
"bool": "boolean",
SqlUtil::CHAR: "char",
SqlUtil::CLOB: "text",
SqlUtil::BLOB: "bytea",
);
const PgsqlTableDescriptionHashOptions = AbstractTable::TableDescriptionHashOptions + (
"functions": Type::Hash,
);
const PgsqlColumnDescOptions = AbstractTable::ColumnDescOptions;
const PgsqlIndexOptions = AbstractTable::IndexOptions;
const PgsqlConstraintOptions = AbstractTable::ConstraintOptions + PgsqlIndexOptions + (
"index": Type::String,
);
const PgsqlTableCreationOptions = AbstractTable::TableCreationOptions + PgsqlConstraintOptions + (
"omit_trigger_functions": Type::Boolean,
);
const PgsqlAlignTableOptions = AbstractTable::AlignTableOptions + PgsqlTableCreationOptions;
const PgsqlCopMap = DefaultCopMap + (
COP_OVER: (
"argcolumn": True,
"argoptional": True,
"code": string (*string cve, *string arg) {
string sql = cve + " over (";
if (arg)
sql += sprintf("partition by %s", arg);
sql += ")";
return sql;
},
),
COP_YEAR: (
"code": string (string arg1, any arg) {
return sprintf("to_char(%s, 'YYYY')", arg1);
}
),
COP_YEAR_MONTH: (
"code": string (string arg1, any arg) {
return sprintf("to_char(%s, 'YYYY-MM')", arg1);
}
),
COP_YEAR_DAY: (
"code": string (string arg1, any arg) {
return sprintf("to_char(%s, 'YYYY-MM-DD')", arg1);
}
),
COP_YEAR_HOUR: (
"code": string (string arg1, any arg) {
return sprintf("to_char(%s, 'YYYY-MM-DD HH24')", arg1);
}
),
);
public:
private :
*string tablespace;
string schema;
Functions triggerFunctions;
public:
constructor(AbstractDatasource nds, string nname, *hash opts);
string getSchemaName();
*string getTablespaceName();
PgsqlFunction addTriggerFunction(string tfname, string src, string trigger);
private PgsqlFunction addTriggerFunctionUnlocked(string tfname, string src, string trigger);
string getSqlName();
private hash getTableCreationOptions();
private hash getTableDescriptionHashOptions();
private hash getColumnDescOptions();
private hash getIndexOptions();
private hash getConstraintOptions();
private hash getAlignTableOptions();
private hash getColumnOperatorMap();
private bool checkExistenceImpl();
private Columns describeImpl();
private PgsqlPrimaryKey getPrimaryKeyImpl();
private Indexes getIndexesImpl();
private ForeignConstraints getForeignConstraintsImpl(*hash opts);
private Constraints getConstraintsImpl();
private Triggers getTriggersImpl();
private string getCreateTableSqlImpl(*hash opt);
private *list getCreateMiscSqlImpl(*hash opt, bool cache);
private *list getAlignSqlImpl(AbstractTable table, *hash opt);
private string getCreateSqlImpl(list l);
private string getRenameSqlImpl(string new_name);
private AbstractColumn addColumnImpl(string cname, hash opt, bool nullable = True);
private AbstractPrimaryKey addPrimaryKeyImpl(string cname, hash ch, *hash opt);
private AbstractIndex addIndexImpl(string iname, bool enabled, hash ch, *hash opt);
private AbstractForeignConstraint addForeignConstraintImpl(string cname, hash ch, string table, hash tch, *hash opt);
private AbstractCheckConstraint addCheckConstraintImpl(string cname, string src, *hash opt);
private AbstractUniqueConstraint addUniqueConstraintImpl(string cname, hash ch, *hash opt);
private AbstractTrigger addTriggerImpl(string tname, string src, *hash opt);
private bool tryInsertImpl(string sql, hash row);
private hash getQoreTypeMapImpl();
private hash getTypeMapImpl();
private *string getSqlValueImpl(any v);
private bool emptyImpl();
private clearImpl();
private softlist getDropSqlImpl();
private setupTableImpl(hash desc, *hash opt);
private bool constraintsLinkedToIndexesImpl();
private bool uniqueIndexCreatesConstraintImpl();
private bool supportsTablespacesImpl();
private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh);
private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch);
private any tryExecArgsImpl(string sql, *softlist args);
private any tryExecRawImpl(string sql, *softlist args);
private copyImpl(AbstractTable old);
};
};
SqlUtil::AbstractConstraint::name
string name
PgsqlSqlUtil::PgsqlView::viewowner
*string viewowner
Owner of the view.
Definition: PgsqlSqlUtil.qm.dox.h:501
Date
const Date
PgsqlSqlUtil::PgsqlDatabase::supportsPackagesImpl
private bool supportsPackagesImpl()
returns True if the database supports packages
PgsqlSqlUtil::PgsqlTable::getTablespaceName
*string getTablespaceName()
returns the data tablespace name for the table or NOTHING if none is known
Hash
const Hash
PgsqlSqlUtil::PgsqlView
represents a PostgreSQL view
Definition: PgsqlSqlUtil.qm.dox.h:495
String
const String
PgsqlSqlUtil::PgsqlDatabase::tryExecArgsImpl
private any tryExecArgsImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
PgsqlSqlUtil::PgsqlCheckConstraint
represents a PostgreSQL-specific check constraint
Definition: PgsqlSqlUtil.qm.dox.h:285
sprintf
string sprintf(string fmt,...)
SqlUtil::AbstractTable
DefaultCopMap
const DefaultCopMap
PgsqlSqlUtil::PgsqlDatabase::listProceduresImpl
private list listProceduresImpl()
since PostgreSQL only supports functions, this method is identical to listFunctionsImpl() ...
PgsqlSqlUtil::PgsqlDatabase
provides the PostgreSQL-specific implementation of the AbstractDatabase interface ...
Definition: PgsqlSqlUtil.qm.dox.h:593
PgsqlSqlUtil::PgsqlTable::supportsTablespacesImpl
private bool supportsTablespacesImpl()
returns True if the database support tablespaces
PgsqlSqlUtil::PgsqlTable::uniqueIndexCreatesConstraintImpl
private bool uniqueIndexCreatesConstraintImpl()
returns True if the database automatically creates a unique constraint when a unique index is created...
PgsqlSqlUtil::PgsqlSequence::getRenameSql
string getRenameSql(string new_name)
returns a string that can be used to rename the sequence in the database
PgsqlSqlUtil::PgsqlTable::constraintsLinkedToIndexesImpl
private bool constraintsLinkedToIndexesImpl()
returns True if the database links constraints to indexes (ie dropping the constraint drops the index...
SqlUtil::AbstractTable::cache
cache(*hash opts)
PgsqlSqlUtil::PgsqlSequence::getCreateSql
string getCreateSql(*hash opt)
returns a string that can be used to create the sequence in the database
PgsqlSqlUtil::PgsqlIndex::getCreateSql
string getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the index in the database
SqlUtil::AbstractIndex
PgsqlSqlUtil::PgsqlColumn
represents a PostgreSQL-specific column
Definition: PgsqlSqlUtil.qm.dox.h:302
PgsqlSqlUtil::PgsqlTable::PgsqlNameMap
const PgsqlNameMap
maps from verbose type names to simple type names
Definition: PgsqlSqlUtil.qm.dox.h:758
PgsqlSqlUtil::PgsqlTrigger::equalImpl
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
COP_OVER
const COP_OVER
PgsqlSqlUtil::PgsqlTrigger
represents a PostgreSQL-specific trigger
Definition: PgsqlSqlUtil.qm.dox.h:521
PgsqlSqlUtil::PgsqlFunction::getCreateSql
softlist getCreateSql(*hash opt)
returns a string that can be used to create the function in the database
PgsqlSqlUtil::PgsqlFunction::setName
setName(string new_name)
sets the new name of the function
PgsqlSqlUtil::PgsqlType
represents a PostgreSQL type
Definition: PgsqlSqlUtil.qm.dox.h:206
PgsqlSqlUtil::PgsqlTable::clearImpl
private clearImpl()
clears PostgreSQL-specific table information
SqlUtil::NumericColumnInfo
True
const True
PgsqlSqlUtil::PgsqlTable::getColumnOperatorMap
private hash getColumnOperatorMap()
returns the column operator map for this object
SZ_MAND
const SZ_MAND
PgsqlSqlUtil::PgsqlPrimaryKey::memberGate
PgsqlColumn memberGate(string k)
returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception ...
SqlUtil::CHAR
const CHAR
PgsqlSqlUtil::PgsqlTriggerFunction::trigger
string trigger
trigger name
Definition: PgsqlSqlUtil.qm.dox.h:584
PgsqlSqlUtil::PgsqlFunction::equalImpl
private bool equalImpl(AbstractFunctionBase t)
returns True if the argument is equal to the current object, False if not
SqlUtil::AbstractSequence
PgsqlSqlUtil::PgsqlDatabase::tryExecArgs
static any tryExecArgs(AbstractDatasource ds, string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
PgsqlSqlUtil::PgsqlIndex
represents a PostgreSQL-specific index
Definition: PgsqlSqlUtil.qm.dox.h:241
PgsqlSqlUtil::PgsqlTable::PgsqlTableDescriptionHashOptions
const PgsqlTableDescriptionHashOptions
extends SqlUtil::AbstractTable::TableDescriptionHashOptions with &quot;functions&quot; for table functions requ...
Definition: PgsqlSqlUtil.qm.dox.h:780
number
number number(softnumber n)
COP_YEAR_HOUR
const COP_YEAR_HOUR
PgsqlSqlUtil::PgsqlTriggerFunction
represents a PostgreSQL-specific trigger function
Definition: PgsqlSqlUtil.qm.dox.h:579
PgsqlSqlUtil::PgsqlTable::tryExecArgsImpl
private any tryExecArgsImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
PgsqlSqlUtil::PgsqlColumn::byte_size
int byte_size
byte size of the column
Definition: PgsqlSqlUtil.qm.dox.h:307
PgsqlSqlUtil::PgsqlView::getCreateSql
string getCreateSql(*hash opt)
returns a string that can be used to create the view in the database
PgsqlSqlUtil::PgsqlIndex::tablespace
*string tablespace
the tablespace name of the index
Definition: PgsqlSqlUtil.qm.dox.h:246
SqlUtil::AbstractForeignConstraint
PgsqlSqlUtil::PgsqlNumericColumn
represents a PostgreSQL-specific numeric column
Definition: PgsqlSqlUtil.qm.dox.h:364
SqlUtil::AbstractSqlUtilBase::l
Mutex l()
SqlUtil::AbstractCheckConstraint
list
list list(...)
Float
const Float
PgsqlSqlUtil::PgsqlTable::QoreTypeMap
const QoreTypeMap
maps qore type names to postgresql type names
Definition: PgsqlSqlUtil.qm.dox.h:766
PgsqlSqlUtil::PgsqlDatabase::tryExecRaw
static any tryExecRaw(AbstractDatasource ds, string sql)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
PgsqlSqlUtil::PgsqlTable::getSchemaName
string getSchemaName()
returns the schema name
Boolean
const Boolean
PgsqlSqlUtil::PgsqlTable::getSqlName
string getSqlName()
returns the name of the table to be used in SQL (with a possible qualifiers for schema, etc)
PgsqlSqlUtil::PgsqlDatabase::tryExecRawImpl
private any tryExecRawImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
SZ_NUM
const SZ_NUM
PgsqlSqlUtil::PgsqlSequence::constructor
constructor(string n_name, number n_start=1, number n_increment=1, *softnumber n_end)
creates the object from the arguments
PgsqlSqlUtil::PgsqlType::name
string name
the name of the type
Definition: PgsqlSqlUtil.qm.dox.h:211
SqlUtil::AbstractColumn::getCreateSql
string getCreateSql()
PgsqlSqlUtil::PgsqlTrigger::getDropSql
softlist getDropSql(string table_name)
returns a string that can be used to drop the trigger from the database
PgsqlSqlUtil::PgsqlTrigger::getCreateSql
softlist getCreateSql(string table_name, *hash opt)
returns a string that can be used to create the trigger in the database
Binary
const Binary
PgsqlSqlUtil::PgsqlTable::doSelectLimitOnlyUnlockedImpl
private doSelectLimitOnlyUnlockedImpl(reference sql, reference args, *hash qh)
processes a string for use in SQL select statements when there is a &quot;limit&quot; argument, but no &quot;orderby&quot; or &quot;offset&quot; arguments
PgsqlSqlUtil::PgsqlDatabase::supportsSequencesImpl
private bool supportsSequencesImpl()
returns True if the database supports sequences
PgsqlSqlUtil::PgsqlColumn::getRenameSql
string getRenameSql(AbstractTable t, string new_name)
returns a string that can be used to rename the column
PgsqlSqlUtil::PgsqlTable::PgsqlTypeMap
const PgsqlTypeMap
maps postgresql type names to type configurations
Definition: PgsqlSqlUtil.qm.dox.h:720
PgsqlSqlUtil::PgsqlIndex::getRenameSql
string getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the index in the database
COP_YEAR_MONTH
const COP_YEAR_MONTH
PgsqlSqlUtil::PgsqlTable::tryExecRawImpl
private any tryExecRawImpl(string sql, *softlist args)
tries to execute a command so that if an error occurs the current transaction status is not lost ...
PgsqlSqlUtil::PgsqlTable::triggerFunctions
Functions triggerFunctions
contains any trigger functions supporting triggers on the table
Definition: PgsqlSqlUtil.qm.dox.h:843
PgsqlSqlUtil::PgsqlTable::getSqlValueImpl
private *string getSqlValueImpl(any v)
returns a string for use in SQL queries representing the DB-specific value of the argument; returns N...
PgsqlSqlUtil::PgsqlDatabase::PgsqlSchemaDescriptionOptions
const PgsqlSchemaDescriptionOptions
PostgreSQL-specific schema description keys.
Definition: PgsqlSqlUtil.qm.dox.h:598
SqlUtil::BLOB
const BLOB
PgsqlSqlUtil::PgsqlDatabase::supportsTypesImpl
private bool supportsTypesImpl()
returns True if the database supports named types
PgsqlSqlUtil::PgsqlTrigger::getRenameSql
softlist getRenameSql(string table_name, string new_name)
returns a string that can be used to rename the trigger in the database
type
string type(any arg)
SqlUtil::CLOB
const CLOB
PgsqlSqlUtil::PgsqlType::src
string src
the source of the type
Definition: PgsqlSqlUtil.qm.dox.h:214
PgsqlSqlUtil::PgsqlPrimaryKey
represents a PostgreSQL-specific primary key constraint
Definition: PgsqlSqlUtil.qm.dox.h:442
string
string string(softstring str)
SqlUtil::AbstractSqlUtilBase::ds
AbstractDatasource ds
SqlUtil::AbstractFunction
SqlUtil::AbstractView
SqlUtil::AbstractSqlUtilBase::opts
*hash opts
SqlUtil::AbstractDatabase::native_case
bool native_case
PgsqlSqlUtil::PgsqlColumn::equalImpl
private bool equalImpl(AbstractColumn c)
returns True if the argument is equal to the current object, False if not
PgsqlSqlUtil::PgsqlIndex::equalImpl
private bool equalImpl(AbstractIndex ix)
returns True if the argument is equal to the current index, False if not
PgsqlSqlUtil::PgsqlView::getRenameSql
softlist getRenameSql(string new_name)
returns a string that can be used to rename the view in the database
Int
const Int
PgsqlSqlUtil::PgsqlDatabase::listTablesImpl
private list listTablesImpl()
returns a list of string table names in the database
COP_YEAR
const COP_YEAR
PgsqlSqlUtil::PgsqlTable::tablespace
*string tablespace
tablespace name for the table, if known
Definition: PgsqlSqlUtil.qm.dox.h:837
SqlUtil::AbstractTrigger
PgsqlSqlUtil::PgsqlDatabase::getNextSequenceValueImpl
private softint getNextSequenceValueImpl(string name)
returns the next value in the given sequence
PgsqlSqlUtil::PgsqlForeignConstraint
represents a PostgreSQL-specific foreign constraint
Definition: PgsqlSqlUtil.qm.dox.h:268
SqlUtil::AbstractColumn
COP_YEAR_DAY
const COP_YEAR_DAY
PgsqlSqlUtil::PgsqlView::constructor
constructor(string n_name, string n_src, *string n_schemaname, *string n_viewowner)
creates the object from the arguments
PgsqlSqlUtil::PgsqlFunction::getDropSql
string getDropSql()
returns a string that can be used to drop the function from the database
PgsqlSqlUtil::PgsqlTrigger::constructor
constructor(string n, string n_src)
creates the object and sets its name and the trigger source
PgsqlSqlUtil::PgsqlIndex::constructor
constructor(string n_name, bool n_unique, hash n_cols, *string n_tablespace)
creates the object from the arguments
PgsqlSqlUtil::PgsqlTable::schema
string schema
schema name for the table
Definition: PgsqlSqlUtil.qm.dox.h:840
hash
hash hash(object obj)
PgsqlSqlUtil::PgsqlTable::PgsqlCopMap
const PgsqlCopMap
column operator specializations for PostgreSQL
Definition: PgsqlSqlUtil.qm.dox.h:799
PgsqlSqlUtil::PgsqlColumn::getModifySqlImpl
list getModifySqlImpl(AbstractTable t, AbstractColumn col, *hash opt)
returns a list of sql strings that can be used to modify the column to the new definition; if the col...
SZ_OPT
const SZ_OPT
PgsqlSqlUtil::PgsqlTable::doSelectOrderByWithOffsetSqlUnlockedImpl
private doSelectOrderByWithOffsetSqlUnlockedImpl(reference sql, reference args, *hash qh, *hash jch, *hash ch)
processes a string for use in SQL select statements when there is an &quot;order by&quot; and &quot;offset&quot; argument...
PgsqlSqlUtil::PgsqlSequence
class for PostgreSQL sequences
Definition: PgsqlSqlUtil.qm.dox.h:478
SqlUtil::AbstractDatabase
PgsqlSqlUtil::get_table
PgsqlTable get_table(AbstractDatasource nds, string nname, *hash opts)
returns a PgsqlTable object corresponding to the arguments
PgsqlSqlUtil::PgsqlTable
provides the PostgreSQL-specific implementation of the SqlUtil::AbstractTable interface ...
Definition: PgsqlSqlUtil.qm.dox.h:715
SqlUtil::AbstractPrimaryKey
PgsqlSqlUtil::PgsqlDatabase::getSchemaDescriptionOptions
private hash getSchemaDescriptionOptions()
returns driver-specific options to the base abstract class
PgsqlSqlUtil::PgsqlFunction::getRenameSql
softlist getRenameSql(string new_name)
returns a string that can be used to rename the function in the database
Number
const Number
PgsqlSqlUtil::get_database
PgsqlDatabase get_database(AbstractDatasource nds, *hash opts)
returns a PgsqlDatabase object corresponding to the arguments
PgsqlSqlUtil::PgsqlFunction
represents a PostgreSQL-specific function
Definition: PgsqlSqlUtil.qm.dox.h:546
PgsqlSqlUtil::PgsqlTable::copyImpl
private copyImpl(AbstractTable old)
db-specific copy actions
SqlUtil::AbstractUniqueConstraint
PgsqlSqlUtil::PgsqlDatabase::listFunctionsImpl
private list listFunctionsImpl()
returns a list of string function names in the database