Qore SqlUtil Module Reference 1.9.1
Loading...
Searching...
No Matches
SqlUtil::AbstractColumn Class Referenceabstract

the base class for column information More...

#include <SqlUtil.qm.dox.h>

Inheritance diagram for SqlUtil::AbstractColumn:
[legend]

Public Member Methods

bool equal (AbstractColumn c)
 returns True if the argument is equal to the current object, False if not
 
abstract list< auto > getAddColumnSql (AbstractTable t)
 returns a list of sql strings that can be used to add the column to an existing table More...
 
string getCreateSql (AbstractTable t)
 returns an sql string that can be used to add the column to a table
 
hash< GenericColumnInfogetDescriptionHash ()
 Returns a description hash of the column. More...
 
string getDropSql (string table_name)
 returns a string that can be used to drop the column from the table
 
list< auto > getModifySql (AbstractTable t, AbstractColumn c, *hash< auto > opt)
 returns a list of sql strings that can be used to modify the column to the new definition; if the column definitions are identical then an empty list is returned More...
 
string getNativeTypeString ()
 returns the string describing the native type that can be used in SQL More...
 
abstract string getRenameSql (AbstractTable t, string new_name)
 returns a string that can be used to rename the column More...
 
- Public Member Methods inherited from SqlUtil::AbstractDdlObject
 constructor (string name)
 creates the object from the name
 
abstract string getDdlName (string name)
 returns the column name with quoting in case the column name is a reserved word More...
 

Public Attributes

*string comment
 comment on the column
 
*string def_val
 default value for column
 
const DefaultVarcharSize = 80
 Default VARCHAR column size.
 
string native_type
 the native type name of the column
 
bool nullable
 True if the column can hold a NULL value, False if not
 
*string qore_type
 the equivalent qore type name of the column if known
 
*int scale
 the scale for numeric columns
 
int size
 the size of the column
 
- Public Attributes inherited from SqlUtil::AbstractDdlObject
string ddl_name
 the name of the object for DDL (in case it's a reserved word)
 
string name
 the name of the object
 

Private Member Methods

 constructor ()
 empty constructor for subclasses
 
abstract bool equalImpl (AbstractColumn c)
 returns True if the argument is equal to the current object, False if not
 
abstract list< auto > getModifySqlImpl (AbstractTable t, AbstractColumn c, *hash< auto > opt)
 returns a list of sql strings that can be used to modify the column to the new definition More...
 
- Private Member Methods inherited from SqlUtil::AbstractDdlObject
 constructor ()
 empty constructor for subclasses
 

Detailed Description

the base class for column information

Member Function Documentation

◆ getAddColumnSql()

abstract list< auto > SqlUtil::AbstractColumn::getAddColumnSql ( AbstractTable  t)
pure virtual

returns a list of sql strings that can be used to add the column to an existing table

Example:
list l = col.getAddColumnSql(t);
Parameters
tthe AbstractTable object to modify
Returns
a list of sql strings that can be used to add the column to an existing table

◆ getDescriptionHash()

hash< GenericColumnInfo > SqlUtil::AbstractColumn::getDescriptionHash ( )

Returns a description hash of the column.

Returns
a description hash of the column
Since
SqlUtil 1.7.5

◆ getModifySql()

list< auto > SqlUtil::AbstractColumn::getModifySql ( AbstractTable  t,
AbstractColumn  c,
*hash< auto >  opt 
)

returns a list of sql strings that can be used to modify the column to the new definition; if the column definitions are identical then an empty list is returned

Example:
list l = col.getModifySql(t, newcol);

The column names are assumed to be equal.

Parameters
tthe AbstractTable object to modify
cthe new column definition
optcolumn modification options (if supported by the underlying driver)
Returns
a list of sql strings that can be used to modify the column to the new definition; if the column definitions are identical then an empty list is returned

◆ getModifySqlImpl()

abstract list< auto > SqlUtil::AbstractColumn::getModifySqlImpl ( AbstractTable  t,
AbstractColumn  c,
*hash< auto >  opt 
)
privatepure virtual

returns a list of sql strings that can be used to modify the column to the new definition

If the column definitions are identical then an empty list is returned

Example:
list l = col.getModifySql(t, newcol);

The column names are assumed to be equal.

Parameters
tthe AbstractTable object to modify
cthe new column definition
optcolumn modification options (if supported by the underlying driver)
Returns
a list of sql strings that can be used to modify the column to the new definition; if the column definitions are identical then an empty list is returned

◆ getNativeTypeString()

string SqlUtil::AbstractColumn::getNativeTypeString ( )

returns the string describing the native type that can be used in SQL

for example to add the colunn to a table or when creating the table

◆ getRenameSql()

abstract string SqlUtil::AbstractColumn::getRenameSql ( AbstractTable  t,
string  new_name 
)
pure virtual

returns a string that can be used to rename the column

Example:
string str = col.getRenameSql(t, "new_name");
Parameters
tthe AbstractTable object to modify
new_namethe new name for the column
Returns
a string that can be used to rename the column