Skip to content

SqlServerGenerator Class ​

Definition ​

Provides SQL Generation routines for a SQL Server database

  • Namespace: JASE.Database.SqlGenerators
  • Assembly: JASE.Database.dll

Constructors ​

NameDescription
SqlServerGenerator(ISqlGeneratorOptions options = null)Create an Sql Generator for a SQL Server database

Fields ​

NameDescription
FtsCatalogNameShared full-text catalog used for column-driven FtsIndex specials.

Properties ​

NameDescription
OptimizeSequentialPrimaryKeysOptimize Primary Keys with OPTIMIZE_FOR_SEQUENTIAL_KEY flag
TypeType of Datatype this Generator is for

Methods ​

NameDescription
ISqlStatement AcquireDatabaseLock(string resource, DatabaseLockMode mode, DatabaseLockOwner owner)Generates a non-blocking attempt to acquire a database-backed application lock. The scalar result is 1 when acquired, 0 when contended, or a negative provider error code.
string AlterTable(ITableInfo table, TableDifferences differences)Generate an ALTER TABLE statement based on derived TableDifferences
string CreateIndex(IndexInformation index, bool noLock)Generate SQL for creating an INDEX from an IndexInformation definition.
string CreateTable(ITableInfo table)Generates SQL for creating a new table
string CreateView(string schema, string name, string selectSql)Generates SQL for creating or replacing a view whose body is selectSql.
string DescribeSchemaTables(string schema, ref List<Parameter> parameters)Generates SQL for describing all table objects within a schema
string DescribeTable(ITableInfo tableInfo, out List<Parameter> parameters)Generates SQL for describing a table object, generally used to obtain IColumnInfo data about a table
string DescribeTable(string table, string schema, out List<Parameter> parameters)Generates SQL for describing a table object, generally used to obtain IColumnInfo data about a table
string DropConstraint(Constraint constraint)Returns SQL for dropping a constraint from a table
string DropIndex(IndexInformation index)Generates SQL to drop the requested index
string DropTable(string table)Generate SQL for dropping a table by name
string DropTables(IEnumerable<string> tables)Returns SQL Statement formatted for deleting multiple tables at once
ulong GetCacheKey()FNV-1a Cache key based on generator type
string GetConstraints()Returns SQL for retrieveing the CONSTRAINTS for a table object
string GetDbColumnType(IColumnInfo info)Resolves the database-specific column type for a given column.
string GetIndexes()Return SQL to get all defined index in the database
string GetIndexes(string schema)Return SQL to get all defined index in the database
string GetIndexesByTable(ITableInfo table)Return SQL to get indexes for a specific table
ISqlStatement ReleaseDatabaseLock(string resource, DatabaseLockMode mode, DatabaseLockOwner owner)Generates a command that releases one acquisition of a database-backed application lock.
string RenameConstraint(string constraint, string newName)Generates SQL for performing a RENAME on a table object
string RenameTable(string tableName, string newName)Generate SQL for Renaming an existing table in the database
string SetColumnComment(ITableInfo table, IColumnInfo column)Generates SQL to set or replace the comment on a column.
string SetIndexComment(IndexInformation index)Generates SQL to set or replace the comment on an index.
string SetTableComment(ITableInfo table)Generates SQL to set or replace the comment on a table.