public override string Translate(SqlCompilerContext context, SqlCreateTable node, CreateTableSection section) { switch (section) { case CreateTableSection.Entry: var builder = new StringBuilder(); builder.Append("CREATE "); var temporaryTable = node.Table as TemporaryTable; if (temporaryTable != null) { if (temporaryTable.IsGlobal) { temporaryTable.DbName = "##" + temporaryTable.Name; } else { temporaryTable.DbName = "#" + temporaryTable.Name; } } builder.Append("TABLE " + Translate(context, node.Table)); return(builder.ToString()); case CreateTableSection.Exit: string result = string.IsNullOrEmpty(node.Table.Filegroup) ? string.Empty : " ON " + QuoteIdentifier(node.Table.Filegroup); return(result); } return(base.Translate(context, node, section)); }
protected override bool VisitCreateTableConstraints(SqlCreateTable node, IEnumerable <TableConstraint> constraints, bool hasItems) { // SQLite has special syntax for autoincrement primary keys // We write everything when doing translation for column definition // and should skip any PK definitions here. var hasAutoIncrementColumn = node.Table.TableColumns.Any(c => c.SequenceDescriptor != null); constraints = hasAutoIncrementColumn ? constraints.Where(c => !(c is PrimaryKey)) : constraints; return(base.VisitCreateTableConstraints(node, constraints, hasItems)); }
public override void Visit(SqlCreateTable node) { var table = node.Table as TemporaryTable; if (table != null && !table.IsGlobal) { throw new NotSupportedException(Strings.ExOracleDoesNotSupportLocalTemporaryTables); } base.Visit(node); }
public override string Translate(SqlCompilerContext context, SqlCreateTable node, CreateTableSection section) { switch (section) { case CreateTableSection.Exit: return("WITHOUT OIDS " + base.Translate(context, node, section)); default: return(base.Translate(context, node, section)); } }
protected override bool UpdateDBTables() { if (dbVersion < 2) { if (!SqlProxyDatabaseHelper.SearchColumn(CustomerTable.Email, GlobalInfo.SqlConnection)) { SqlCreateTable.AlterTable <CustomerTable>(); SqlCreateTable.AddColumn(CustomerTable.Email); SqlCreateTable.Alter(); } } return(true); }
/// <inheritdoc/> public override string Translate(SqlCompilerContext context, SqlCreateTable node, CreateTableSection section) { switch (section) { case CreateTableSection.Entry: var builder = new StringBuilder(); builder.Append("CREATE "); var temporaryTable = node.Table as TemporaryTable; if (temporaryTable != null) { builder.Append("TEMPORARY TABLE " + Translate(context, temporaryTable)); } else { builder.Append("TABLE " + Translate(context, node.Table)); } return(builder.ToString()); case CreateTableSection.Exit: return(string.Empty); } return(base.Translate(context, node, section)); }
public virtual void Visit(SqlCreateTable node) { }
public void Test150() { SqlCreateTable create = SqlDdl.Create(Catalog.Schemas["main"].Tables["customer"]); Console.Write(Compile(create)); }
public void Test150() { SqlCreateTable create = SqlDdl.Create(schema.Tables["customer"]); Console.Write(Compile(create)); }
public void Visit(SqlCreateTable node) { }