Loading...
Searching...
No Matches
MssqlSqlUtilBase::MssqlUniqueConstraint Class Reference

class modeling a unique constraint More...

Inheritance diagram for MssqlSqlUtilBase::MssqlUniqueConstraint:
[legend]

## Public Member Functions

| constructor (string n, hash n_cols, bool e=True, __7_ string ts)
| creates the object with the given attributes
string | getCreateSql (string name, string table_name, __7_ hash opts)
| returns a string that can be used to rename the constraint
string | getCreateSql (string table_name, __7_ hash opts)
| returns a string that can be used to create the constraint
bool | isEnabled ()
| returns True if the constraint is enabled, False if not
MssqlColumn | memberGate (string k)
| returns the MssqlColumn value of the given key if it exists, otherwise throws a `KEY-ERROR` exception
Public Member Functions inherited from MssqlSqlUtilBase::MssqlUniqueConstraintCommon
| clearIndex ()
| clears any index base for the constraint
| constructor (__7_ string ts)
| creates the constraint with an optional filegroup name
| getIndexSql (reference< string > sql, string name, __7_ hash opts)
| adds index options onto the sql creation string
__7_ string | getTablespace ()
| returns the filegroup name used for this constraint, if known
bool | setIndexBase (string ix)
| sets the supporting index name
| setTablespace (__7_ string ts)
| sets or clears the filegroup name

## Protected Attributes

bool | enabled
| True if the constraint is enabled, False if not
Protected Attributes inherited from MssqlSqlUtilBase::MssqlUniqueConstraintCommon
__7_ string | filegroup
| any filegroup for the unique key index

## Additional Inherited Members

Protected Member Functions inherited from MssqlSqlUtilBase::MssqlUniqueConstraintCommon
| constructor ()
| empty constructor for subclasses

## Detailed Description

class modeling a unique constraint

## Member Function Documentation

## constructor()

MssqlSqlUtilBase::MssqlUniqueConstraint::constructor | ( | string | n,
|  | hash | n_cols,
|  | bool | e = `True`,
|  | __7_ string | ts
| ) |  |

creates the object with the given attributes

Parameters

  n | name of the constraint
  n_cols | column hash
  e | the enabled status of the constraint
  ts | optional filegroup name

## memberGate()

MssqlColumn MssqlSqlUtilBase::MssqlUniqueConstraint::memberGate | ( | string | k | ) |

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

Example:
  auto v = c.name;

Parameters

  k | the name of the key to access

Returns
  the value of the given key in the contained hash if it exists

Exceptions

  KEY-ERROR | the 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