SchemaProvisioner

Implements basic functionality for a ISchemaProvisioner.

Namespace:
KpokPatagon.Data.DatabaseSchema
Type:
Class
Public:
Yes
Protected:
No
Sealed:
No
Abstract:
Yes
Implements:
KpokPatagon.Data.DatabaseSchema.ISchemaProvisioner

Properties

CommandBuilder

Gets or sets the command builder service.

Signature:
public IDbCmdBuilder CommandBuilder { get; set; }

Methods

AddColumn

Adds a column to a table.

Signature:
public Void AddColumn(table, column)
Parameters
Name Type Summary
table Table Table to be altered.
column TableColumn Column to be added.

AddColumnConstraint

Adds a column constraint.

Signature:
public Void AddColumnConstraint(table, column, constraint)
Parameters
Name Type Summary
table Table Table to be alter.
column TableColumn Column to be alter.
constraint ColumnConstraint Contraint to be added.

AddForeignKey

Adds a foreign key to table.

Signature:
public Void AddForeignKey(table, foreignKey)
Parameters
Name Type Summary
table Table Table to be alter.
foreignKey ForeignKey Foreign key to be added.

AlterColumn

Modifies a table column.

Signature:
public Void AlterColumn(table, from, to)
Parameters
Name Type Summary
table Table Table to be alter.
from TableColumn The actual configuration of the column.
to TableColumn The desired configuration of the column.

CreateIndex

Creates an index.

Signature:
public Void CreateIndex(table, index)
Parameters
Name Type Summary
table Table Table to be alter.
index Index Index to be created.

CreatePrimaryKey

Creates a primary key for the table.

Signature:
public Void CreatePrimaryKey(table, primaryKey)
Parameters
Name Type Summary
table Table Table to be alter.
primaryKey Index Primary key to be created.

CreateSchema

Creates a schema.

Signature:
public Void CreateSchema(name)
Parameters
Name Type Summary
name String The name of the schema to create.

CreateSequenceIfNotExists

Creates a sequence if it does not exists.

Signature:
public Void CreateSequenceIfNotExists(sequence)
Parameters
Name Type Summary
sequence Sequence A sequence to be created.

CreateTable

Creates a table.

Signature:
public Void CreateTable(table)
Parameters
Name Type Summary
table Table Table to be created.

CreateView

Creates a view.

Signature:
public Void CreateView(view)
Parameters
Name Type Summary
view View View to be created.

DropColumn

Drops a column from the table.

Signature:
public Void DropColumn(table, column)
Parameters
Name Type Summary
table Table Table to alter.
column TableColumn Column to be dropped.

DropColumnConstraint

Drops a column constraint.

Signature:
public Void DropColumnConstraint(table, column, constraint)
Parameters
Name Type Summary
table Table Table to alter.
column TableColumn Column to alter.
constraint ColumnConstraint Contraint to be dropped.

DropForeignKey

Drops a foreign key.

Signature:
public Void DropForeignKey(table, foreignKey)
Parameters
Name Type Summary
table Table Table to alter.
foreignKey ForeignKey Foreign key to drop.

DropIndex

Drops an index.

Signature:
public Void DropIndex(table, index)
Parameters
Name Type Summary
table Table Table to alter.
index Index Index to drop.

DropPrimaryKey

Drops a primary key index.

Signature:
public Void DropPrimaryKey(table, primaryKey)
Parameters
Name Type Summary
table Table Table to alter.
primaryKey Index Index to drop.

DropTable

Drops a table.

Signature:
public Void DropTable(table)
Parameters
Name Type Summary
table Table Table to drop.

DropView

Drops a view.

Signature:
public Void DropView(view)
Parameters
Name Type Summary
view View View to drop.

GrantPermissions

Grants permissions to a grantee ro access a database object.

Signature:
public Void GrantPermissions(grant)
Parameters
Name Type Summary
grant Grant Grant configuration.

RenameTable

Renames a table.

Signature:
public Void RenameTable(tableName, newTableName)
Parameters
Name Type Summary
tableName TableName Name of the table to be renamed.
newTableName String New table name.