public CreateTableCommand Column(string columnName, DbType dbType, Action <CreateColumnCommand> column = null) { var command = new CreateColumnCommand(Name, columnName); command.WithType(dbType); if (column != null) { column(command); } TableCommands.Add(command); return(this); }
public void AddColumn(string columnName, DbType dbType, Action <AddColumnCommand> column = null) { var command = new AddColumnCommand(Name, columnName); command.WithType(dbType); if (column != null) { column(command); } TableCommands.Add(command); }
public CreateTableCommand Alpha(string columnName, string columnDescription, int length, Action <CreateColumnCommand> column = null) { var command = new CreateColumnCommand(Name, columnName, columnDescription); command.WithType(BoFieldTypes.db_Alpha); command.WithLength(length); if (column != null) { column(command); } TableCommands.Add(command); NeedIndex(command); return(this); }
public AlterTableCommand Date(string columnName, string columnDescription, Action <CreateColumnCommand> column = null) { var command = new CreateColumnCommand(Name, columnName, columnDescription); command .WithType(BoFieldTypes.db_Date) .WithLength(0); if (column != null) { column(command); } TableCommands.Add(command); NeedIndex(command); return(this); }
public CreateTableCommand Integer(string columnName, string columnDescription, Action <CreateColumnCommand> column = null) { var command = new CreateColumnCommand(Name, columnName, columnDescription); command .WithType(BoFieldTypes.db_Numeric) .WithSubType(BoFldSubTypes.st_None) .WithLength(11); if (column != null) { column(command); } TableCommands.Add(command); NeedIndex(command); return(this); }
public CreateTableCommand Percent(string columnName, string columnDescription, Action <CreateColumnCommand> column = null) { var command = new CreateColumnCommand(Name, columnName, columnDescription); command .WithType(BoFieldTypes.db_Float) .WithSubType(BoFldSubTypes.st_Percentage) .WithLength(0) .WithDefault("0"); if (column != null) { column(command); } TableCommands.Add(command); NeedIndex(command); return(this); }
public CreateTableCommand ValidValues(string columnName, string columnDescription, Dictionary <string, string> values, Action <CreateColumnCommand> column = null) { var command = new CreateColumnCommand(Name, columnName, columnDescription); command .WithType(BoFieldTypes.db_Alpha) .WithLength(30); foreach (var val in values) { command.AddValidValue(val.Key, val.Value); } if (column != null) { column(command); } TableCommands.Add(command); NeedIndex(command); return(this); }
public void DropUniqueConstraint(string constraintName) { var command = new DropUniqueConstraintCommand(Name, constraintName); TableCommands.Add(command); }
public void AddUniqueConstraint(string constraintName, params string[] columnNames) { var command = new AddUniqueConstraintCommand(Name, constraintName, columnNames); TableCommands.Add(command); }
public void DropIndex(string indexName) { var command = new DropIndexCommand(Name, indexName); TableCommands.Add(command); }
public void CreateIndex(string indexName, params string[] columnNames) { var command = new AddIndexCommand(Name, indexName, columnNames); TableCommands.Add(command); }
public void DropColumn(string columnName) { var command = new DropColumnCommand(Name, columnName); TableCommands.Add(command); }
public void CreateForeignKey(string key, string[] srcColumns, string destTable, string[] destColumns) { var command = new CreateForeignKeyCommand(key, Name, srcColumns, destTable, destColumns); TableCommands.Add(command); }
public void DropForeignKey(string key) { var command = new DropForeignKeyCommand(Name, key); TableCommands.Add(command); }
public void RenameColumn(string columnName, string newColumnName) { var command = new RenameColumnCommand(Name, columnName, newColumnName); TableCommands.Add(command); }
private void Start() { TableCommands = new TableCommands(_table.Table, _table.FirstPlayer); }