Qore SqlUtil Module Reference 1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Functions Variables Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | List of all members
SqlUtil::AbstractColumn Class Referenceabstract

the base class for column information More...

## Public Member Functions
bool | equal (AbstractColumn c)
| returns True if the argument is equal to the current object, False if not
string | getCreateSql ()
| returns an sql string that can be used to add the column to a table
abstract list | getCreateSql (AbstractTable t)
| returns a list of sql strings that can be used to add the column to an existing table More...
string | getDropSql (string table_name)
| returns a string that can be used to drop the column from the table
list | getModifySql (AbstractTable t, AbstractColumn c, *hash 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 (for example to add the colunn to a table or when creating the table)
abstract string | getRenameSql (AbstractTable t, string new_name)
| returns a string that can be used to rename the column More...

## Public Attributes
*string | comment
| comment on the column
*string | def_val
| default value for column
string | name
| the name of the column
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 | size
| the size of the column

## Private Member Functions
abstract bool | equalImpl (AbstractColumn c)
| returns True if the argument is equal to the current object, False if not
abstract list | getModifySqlImpl (AbstractTable t, AbstractColumn c, *hash 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...

## Detailed Description

the base class for column information

## Member Function Documentation

abstract list SqlUtil::AbstractColumn::getCreateSql | ( | AbstractTable | t | ) |
| pure virtual

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

Example:
  my list $l = $col.getCreateSql($t);

Parameters

  t | the AbstractTable object to modify

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

list SqlUtil::AbstractColumn::getModifySql | ( | AbstractTable | t,
|  | AbstractColumn | c,
|  | *hash | 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:
  my list $l = $col.getModifySql($t, $newcol);

The column names are assumed to be equal.

Parameters

  t | the AbstractTable object to modify
  c | the new column definition

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

abstract list SqlUtil::AbstractColumn::getModifySqlImpl | ( | AbstractTable | t,
|  | AbstractColumn | c,
|  | *hash | opt
| ) |  |
| private pure 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:
  my list $l = $col.getModifySql($t, $newcol);

The column names are assumed to be equal.

Parameters

  t | the AbstractTable object to modify
  c | the new column definition

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

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

returns a string that can be used to rename the column

Example:
  my string $str = $col.getRenameSql($t, "new_name");

Parameters

  t | the AbstractTable object to modify
  new_name | the new name for the column

Returns
  a string that can be used to rename the column