Class SqlTransformBase
transformation base for sql templates.
Inheritance
Inherited Members
Namespace: TimeCockpit.Data.Database.StringTemplates
Assembly: TimeCockpit.Data.dll
Syntax
public abstract class SqlTransformBase
Constructors
SqlTransformBase(StringBuilder, SqlDialect)
Initializes a new instance of the SqlTransformBase class.
Declaration
public SqlTransformBase(StringBuilder generationEnvironment, SqlDialect dialect)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Text.StringBuilder | generationEnvironment | the generation environment. |
| SqlDialect | dialect | the dialect to use. |
SqlTransformBase(SqlDialect)
Initializes a new instance of the SqlTransformBase class.
Declaration
public SqlTransformBase(SqlDialect dialect)
Parameters
| Type | Name | Description |
|---|---|---|
| SqlDialect | dialect | the dialect that this transform happens for. |
Properties
Dialect
Gets the sql dialect to use.
Declaration
public SqlDialect Dialect { get; }
Property Value
| Type | Description |
|---|---|
| SqlDialect |
GenerationEnvironment
Gets or sets the Generation environment.
Declaration
public StringBuilder GenerationEnvironment { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Text.StringBuilder |
PrimaryCulture
Gets the primary culture for a query.
Declaration
public Culture PrimaryCulture { get; }
Property Value
| Type | Description |
|---|---|
| Culture | The primary culture. |
ToStringHelper
Gets or sets the ToStringHelper.
Declaration
public SqlToStringHelper ToStringHelper { get; set; }
Property Value
| Type | Description |
|---|---|
| SqlToStringHelper |
Methods
ColumnName(StorageColumn)
Writes the column name of the storage column.
Declaration
public void ColumnName(StorageColumn property)
Parameters
| Type | Name | Description |
|---|---|---|
| StorageColumn | property | The storage column of the property. |
ColumnNameWithCulture(StorageColumn, Culture)
Writes the column name of the storage column with a postfix of a culture.
Declaration
public void ColumnNameWithCulture(StorageColumn property, Culture culture)
Parameters
| Type | Name | Description |
|---|---|---|
| StorageColumn | property | The storage column of the property. |
| Culture | culture | The culture to get the postfix from. |
DatabaseName(ModelElement)
Writes the Database name of the element.
Declaration
public void DatabaseName(ModelElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelElement | element | The element to print the name of. |
DataType(StorageColumn)
inserts a data type.
Declaration
public void DataType(StorageColumn column)
Parameters
| Type | Name | Description |
|---|---|---|
| StorageColumn | column | the colume whose datatype to insert. |
GO()
inserts the contents of the go template
Declaration
public void GO()
RelationName(RelationBase)
Writes the Relation name of the element.
Declaration
public void RelationName(RelationBase relation)
Parameters
| Type | Name | Description |
|---|---|---|
| RelationBase | relation | The relation to print the name of. |
SchemaTemplate(String)
Writes the schema name followed by a dot to the template result. If schema is null or empty, nothing is written (sql ce)
Declaration
public void SchemaTemplate(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | the schema name, or null if nothing should be printed. |
SchemaTemplateWithEquals(String)
Writes the schema name followed by a dot to the template result. If schema is null or empty, nothing is written (sql ce)
Declaration
public void SchemaTemplateWithEquals(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | the schema name, or null if nothing should be printed. |
TableName(ModelElement)
Writes the TableName.
Declaration
public void TableName(ModelElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelElement | element | the model element to write the tablename for. |
TransformText()
abstract implementation for transforming the text.
Declaration
public abstract string TransformText()
Returns
| Type | Description |
|---|---|
| System.String | returns the generated string. |
Write(String)
Writes the string to the environment.
Declaration
public void Write(string str)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | the string to write. |
WriteLine()
Writes a newline to the environment
Declaration
public void WriteLine()