Show / Hide Table of Contents

Class RDBMSCompiler

Compiles schema scripts into RDBMS-family of outputs - the ones that have tables, keys, indexes, constraints etc...

Inheritance
System.Object
Compiler
RDBMSCompiler
MsSQLServerCompiler
MySQLCompiler
Implements
IConfigurable
INamed
Inherited Members
Compiler.SCRIPT_INCLUDE_SECTION
Compiler.SCRIPT_COMMENT_ATTR
Compiler.SCRIPT_TEXT_SECTION
Compiler.SCRIPT_OUTPUT_NAME_ATTR
Compiler.m_CompileErrors
Compiler.Name
Compiler.Schema
Compiler.HasCompiled
Compiler.CompileException
Compiler.CompileErrors
Compiler.HasErrors
Compiler.NameCaseSensitivity
Compiler.NameComparison
Compiler.OutputPath
Compiler.OutputPrefix
Compiler.Configure(IConfigSectionNode)
Compiler.Compile()
Compiler.EnsureNotCompiled()
Compiler.BuildOutputs(Compiler.Outputs)
Compiler.IncludeScriptFile(IConfigSectionNode, Compiler.Outputs)
Compiler.IncludeScriptText(IConfigSectionNode, Compiler.Outputs)
Compiler.EscapeFileName(String)
Compiler.EscapeString(String)
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()
Namespace: NFX.RelationalModel
Assembly: NFX.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

COMMENT_ATTR

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 = "NFX.RelationalModel.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", "NFX.RelationalModel.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
Type Description
TargetType
Overrides
Compiler.Target

Methods

BuildNodeOutput(IConfigSectionNode, Compiler.Outputs)

Declaration
protected override void BuildNodeOutput(IConfigSectionNode node, Compiler.Outputs outputs)
Parameters
Type Name Description
IConfigSectionNode node
Compiler.Outputs outputs
Overrides
Compiler.BuildNodeOutput(IConfigSectionNode, Compiler.Outputs)

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
Type Description
RDBMSDomain

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
Type Name Description
IConfigSectionNode columnNode
RDBMSEntity table
System.Text.StringBuilder sb
System.Boolean firstColumn
Compiler.Outputs outputs

DoCompile()

Declaration
protected override void DoCompile()
Overrides
Compiler.DoCompile()

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
Type Name Description
RDBMSEntity table
System.Text.StringBuilder sb
System.Boolean firstItem
Compiler.Outputs outputs

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
Type Name Description
IConfigSectionNode idxNode
RDBMSEntity table

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
Type Name Description
IConfigSectionNode pkNode
RDBMSEntity table

DoTable(IConfigSectionNode, Compiler.Outputs)

Override to compile a RDBMS Table

Declaration
protected virtual void DoTable(IConfigSectionNode tableNode, Compiler.Outputs outputs)
Parameters
Type Name Description
IConfigSectionNode tableNode
Compiler.Outputs outputs

DoTableIndexes(RDBMSEntity, Compiler.Outputs)

Override to compile a indexes per table

Declaration
protected virtual void DoTableIndexes(RDBMSEntity table, Compiler.Outputs outputs)
Parameters
Type Name Description
RDBMSEntity table
Compiler.Outputs outputs

FormatColumnStatement(String, String, String, String, String, String, String)

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
Compiler.GetOutputFileSuffix(String)

GetQuotedIdentifierName(RDBMSEntityType, String)

Gets quoted name per particular technology

Declaration
public virtual string GetQuotedIdentifierName(RDBMSEntityType type, string name)
Parameters
Type Name Description
RDBMSEntityType type
System.String name
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
Type Name Description
RDBMSEntityType type
System.Boolean start
Returns
Type Description
System.String

TransformEntityName(RDBMSEntity)

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
Type Name Description
RDBMSEntity entity

TransformKeywordCase(String)

Declaration
public virtual string TransformKeywordCase(string keywords)
Parameters
Type Name Description
System.String keywords
Returns
Type Description
System.String

TransformSortOrder(RDBMSSortOrder)

Declaration
public virtual string TransformSortOrder(RDBMSSortOrder order)
Parameters
Type Name Description
RDBMSSortOrder order
Returns
Type Description
System.String

Implements

IConfigurable
INamed

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX