Class RDBMSCompiler
Compiles schema scripts into RDBMS-family of outputs - the ones that have tables, keys, indexes, constraints etc...
Inheritance
System.Object
RDBMSCompiler
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.dll
Syntax
public abstract class RDBMSCompiler : Compiler, IConfigurable, INamed
Constructors
RDBMSCompiler(Schema)
Declaration
public RDBMSCompiler(Schema schema)
Parameters
Type |
Name |
Description |
Schema |
schema |
|
Fields
CLUSTERED_ATTR
Declaration
public const string CLUSTERED_ATTR = "clustered"
Field Value
Type |
Description |
System.String |
|
COLUMN_SECTION
Declaration
public const string COLUMN_SECTION = "column"
Field Value
Type |
Description |
System.String |
|
Declaration
public const string COMMENT_ATTR = "comment"
Field Value
Type |
Description |
System.String |
|
DEFAULT_ATTR
Declaration
public const string DEFAULT_ATTR = "default"
Field Value
Type |
Description |
System.String |
|
DEFAULT_DOMAIN_SEARCH_PATHS
Declaration
public const string DEFAULT_DOMAIN_SEARCH_PATHS = "Azos.Data.Modeling.DataTypes.*"
Field Value
Type |
Description |
System.String |
|
FOREIGN_KEYS_OUTPUT
Declaration
public const string FOREIGN_KEYS_OUTPUT = "foreignkeys"
Field Value
Type |
Description |
System.String |
|
INDEX_SECTION
Declaration
public const string INDEX_SECTION = "index"
Field Value
Type |
Description |
System.String |
|
INDEXES_OUTPUT
Declaration
public const string INDEXES_OUTPUT = "indexes"
Field Value
Type |
Description |
System.String |
|
LENGTH_ATTR
Declaration
public const string LENGTH_ATTR = "length"
Field Value
Type |
Description |
System.String |
|
NAME_ATTR
Declaration
public const string NAME_ATTR = "name"
Field Value
Type |
Description |
System.String |
|
NOW_FUNC
Declaration
public const string NOW_FUNC = "now()"
Field Value
Type |
Description |
System.String |
|
ORDER_ATTR
Declaration
public const string ORDER_ATTR = "order"
Field Value
Type |
Description |
System.String |
|
PRIMARY_KEY_SECTION
Declaration
public const string PRIMARY_KEY_SECTION = "primary-key"
Field Value
Type |
Description |
System.String |
|
REFERENCE_SECTION
Declaration
public const string REFERENCE_SECTION = "reference"
Field Value
Type |
Description |
System.String |
|
REQUIRED_ATTR
Declaration
public const string REQUIRED_ATTR = "required"
Field Value
Type |
Description |
System.String |
|
SEQUENCES_OUTPUT
Declaration
public const string SEQUENCES_OUTPUT = "sequences"
Field Value
Type |
Description |
System.String |
|
SHORT_NAME_ATTR
Declaration
public const string SHORT_NAME_ATTR = "short-name"
Field Value
Type |
Description |
System.String |
|
TABLE_SECTION
Declaration
public const string TABLE_SECTION = "table"
Field Value
Type |
Description |
System.String |
|
TABLES_OUTPUT
Declaration
public const string TABLES_OUTPUT = "tables"
Field Value
Type |
Description |
System.String |
|
TYPE_ATTR
Declaration
public const string TYPE_ATTR = "type"
Field Value
Type |
Description |
System.String |
|
UNIQUE_ATTR
Declaration
public const string UNIQUE_ATTR = "unique"
Field Value
Type |
Description |
System.String |
|
Properties
DomainSearchPaths
Gets/sets ';' separated list of domain search namespaces paths
Declaration
[Config("$domain-search-paths", "Azos.Data.Modeling.DataTypes.*")]
public virtual string DomainSearchPaths { get; set; }
Property Value
Type |
Description |
System.String |
|
SeparateForeignKeys
Gets/sets the flag that indicates whether foreign keys should be written in the separate output from tables.
Foreign keys get added as constraints under the table when referenced table is already present and this flag is false
Declaration
[Config("$separate-fkeys")]
public virtual bool SeparateForeignKeys { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
SeparateIndexes
Gets/sets the flag that indicates whether indexes should be written in the separate output from tables
Declaration
[Config("$separate-indexes")]
public virtual bool SeparateIndexes { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Target
Declaration
public override TargetType Target { get; }
Property Value
Overrides
Methods
BuildNodeOutput(IConfigSectionNode, Compiler.Outputs)
Declaration
protected override void BuildNodeOutput(IConfigSectionNode node, Compiler.Outputs outputs)
Parameters
Overrides
CreateDomain(String, String, IConfigNode)
Turns domain name into domain instance
Declaration
protected virtual RDBMSDomain CreateDomain(string sourcePath, string name, IConfigNode node)
Parameters
Type |
Name |
Description |
System.String |
sourcePath |
|
System.String |
name |
|
IConfigNode |
node |
|
Returns
DoColumn(IConfigSectionNode, RDBMSEntity, StringBuilder, ref Boolean, Compiler.Outputs)
Override to compile a RDBMS Table
Declaration
protected virtual void DoColumn(IConfigSectionNode columnNode, RDBMSEntity table, StringBuilder sb, ref bool firstColumn, Compiler.Outputs outputs)
Parameters
DoCompile()
Declaration
protected override void DoCompile()
Overrides
DoForeignKeys(RDBMSEntity, StringBuilder, ref Boolean, Compiler.Outputs)
Override to outpur foreign keys
Declaration
protected virtual void DoForeignKeys(RDBMSEntity table, StringBuilder sb, ref bool firstItem, Compiler.Outputs outputs)
Parameters
DoPrimaryKeys(RDBMSEntity, StringBuilder, ref Boolean)
Override to output primary keys
Declaration
protected virtual void DoPrimaryKeys(RDBMSEntity table, StringBuilder sb, ref bool firstItem)
Parameters
Type |
Name |
Description |
RDBMSEntity |
table |
|
System.Text.StringBuilder |
sb |
|
System.Boolean |
firstItem |
|
DoReadIndexSection(IConfigSectionNode, RDBMSEntity)
Override to read primary key definition form sub-section of table (not column level)
Declaration
protected virtual void DoReadIndexSection(IConfigSectionNode idxNode, RDBMSEntity table)
Parameters
DoReadPrimaryKeySection(IConfigSectionNode, RDBMSEntity)
Override to read primary key definition form sub-section of table (not column level)
Declaration
protected virtual void DoReadPrimaryKeySection(IConfigSectionNode pkNode, RDBMSEntity table)
Parameters
DoTable(IConfigSectionNode, Compiler.Outputs)
Override to compile a RDBMS Table
Declaration
protected virtual void DoTable(IConfigSectionNode tableNode, Compiler.Outputs outputs)
Parameters
DoTableIndexes(RDBMSEntity, Compiler.Outputs)
Override to compile a indexes per table
Declaration
protected virtual void DoTableIndexes(RDBMSEntity table, Compiler.Outputs outputs)
Parameters
Declaration
protected virtual string FormatColumnStatement(string column, string type, string nnull, string auto, string dflt, string chk, string comment)
Parameters
Type |
Name |
Description |
System.String |
column |
|
System.String |
type |
|
System.String |
nnull |
|
System.String |
auto |
|
System.String |
dflt |
|
System.String |
chk |
|
System.String |
comment |
|
Returns
Type |
Description |
System.String |
|
GetColumnNullNotNullClause(RDBMSEntity, Boolean)
Declaration
public virtual string GetColumnNullNotNullClause(RDBMSEntity column, bool required)
Parameters
Type |
Name |
Description |
RDBMSEntity |
column |
|
System.Boolean |
required |
|
Returns
Type |
Description |
System.String |
|
GetOutputFileSuffix(String)
Declaration
public override string GetOutputFileSuffix(string outputName)
Parameters
Type |
Name |
Description |
System.String |
outputName |
|
Returns
Type |
Description |
System.String |
|
Overrides
GetQuotedIdentifierName(RDBMSEntityType, String)
Gets quoted name per particular technology
Declaration
public virtual string GetQuotedIdentifierName(RDBMSEntityType type, string name)
Parameters
Returns
Type |
Description |
System.String |
|
GetStatementDelimiterScript(RDBMSEntityType, Boolean)
Override to return statement delimiter script for particular target , i.e. "Go" at the statementend for MsSQL Server T-SQL
Declaration
public virtual string GetStatementDelimiterScript(RDBMSEntityType type, bool start)
Parameters
Returns
Type |
Description |
System.String |
|
Override to map a name from schema into the name that should be used in the output (i.e. real table name)
Declaration
public virtual void TransformEntityName(RDBMSEntity entity)
Parameters
Declaration
public virtual string TransformKeywordCase(string keywords)
Parameters
Type |
Name |
Description |
System.String |
keywords |
|
Returns
Type |
Description |
System.String |
|
Declaration
public virtual string TransformSortOrder(RDBMSSortOrder order)
Parameters
Returns
Type |
Description |
System.String |
|
Implements
Extension Methods