Qore PgsqlSqlUtilBase Module Reference 1.8
Loading...
Searching...
No Matches
PgsqlSqlUtilBase::PgsqlPrimaryKey Class Reference

represents a PostgreSQL-specific primary key constraint More...

Inheritance diagram for PgsqlSqlUtilBase::PgsqlPrimaryKey:
[legend]

Public Member Functions

 constructor ()
 creates an empty primary key object
 constructor (string n, *hash c, *string ts)
 creates the object with the given attributes
string getCreateSql (string table_name, *hash< auto > opts)
 returns a string that can be used to create the constraint
string getDropSql (string table_name)
 returns a string that can be used to drop the constraint from the database
softlist getRenameSql (string table_name, string new_name)
 returns a string that can be used to rename the constraint
PgsqlColumn memberGate (string k)
 returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception
Public Member Functions inherited from PgsqlSqlUtilBase::PgsqlUniqueConstraintCommon
 clearIndex ()
 clears any index base for the constraint
 constructor (*string ts)
 creates the constraint with an optional tablespace name
string getDropSql (string table_name)
 returns a string that can be used to drop the constraint from the database
 getIndexSql (reference< string > sql, string name, *hash opts)
 adds index options onto the sql creation string
*string getTablespace ()
 returns the tablespace name used for this constraint, if known
bool setIndexBase (string ix)
 sets the supporting index name
 setTablespace (*string ts)
 sets or clears the tablespace name

Additional Inherited Members

Protected Attributes inherited from PgsqlSqlUtilBase::PgsqlUniqueConstraintCommon
*string tablespace
 any tablespace for the unique key index

Detailed Description

represents a PostgreSQL-specific primary key constraint

Member Function Documentation

◆ constructor()

PgsqlSqlUtilBase::PgsqlPrimaryKey::constructor ( string n,
*hash c,
*string ts )

creates the object with the given attributes

Parameters
nname of the constraint
ccolumn hash
tsoptional tablespace name

◆ memberGate()

PgsqlColumn PgsqlSqlUtilBase::PgsqlPrimaryKey::memberGate ( string k)

returns the PgsqlColumn value of the given key if it exists, otherwise throws a KEY-ERROR exception

Example:
auto v = c.name;
Parameters
kthe name of the key to access
Returns
the value of the given key in the contained hash if it exists
Exceptions
KEY-ERRORthe given key does not exist in the contained hash
Note
this method is called automatically when an unknown or inaccessible member name is accessed from outside the class
See also
memberGate() Method