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);
        }
Exemple #8
0
        public void DropUniqueConstraint(string constraintName)
        {
            var command = new DropUniqueConstraintCommand(Name, constraintName);

            TableCommands.Add(command);
        }
Exemple #9
0
        public void AddUniqueConstraint(string constraintName, params string[] columnNames)
        {
            var command = new AddUniqueConstraintCommand(Name, constraintName, columnNames);

            TableCommands.Add(command);
        }
Exemple #10
0
        public void DropIndex(string indexName)
        {
            var command = new DropIndexCommand(Name, indexName);

            TableCommands.Add(command);
        }
Exemple #11
0
        public void CreateIndex(string indexName, params string[] columnNames)
        {
            var command = new AddIndexCommand(Name, indexName, columnNames);

            TableCommands.Add(command);
        }
Exemple #12
0
        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);
        }
Exemple #15
0
        public void RenameColumn(string columnName, string newColumnName)
        {
            var command = new RenameColumnCommand(Name, columnName, newColumnName);

            TableCommands.Add(command);
        }
Exemple #16
0
 private void Start()
 {
     TableCommands = new TableCommands(_table.Table, _table.FirstPlayer);
 }