Beispiel #1
0
 public static IndexInfo Read(FirebirdProcessor processor, string indexName)
 {
     using (DataSet ds = processor.Read(singleQuery, AdoHelper.FormatValue(indexName)))
     {
         return(new IndexInfo(ds.Tables[0].Rows[0], processor));
     }
 }
Beispiel #2
0
 private TriggerInfo(DataRow drTrigger, FirebirdProcessor processor)
 {
     Name     = drTrigger["rdb$trigger_name"].ToString().Trim();
     Sequence = AdoHelper.GetIntValue(drTrigger["rdb$trigger_sequence"]) ?? 0;
     Type     = AdoHelper.GetIntValue(drTrigger["rdb$trigger_type"]) ?? 1;
     Body     = drTrigger["rdb$trigger_source"].ToString().Trim();
 }
Beispiel #3
0
        public static TableInfo Read(FirebirdProcessor processor, string tableName)
        {
            var quoter      = new FirebirdQuoter();
            var fbTableName = quoter.ToFbObjectName(tableName);

            return(new TableInfo(processor.Read(query, AdoHelper.FormatValue(fbTableName)).Tables[0].Rows[0]));
        }
Beispiel #4
0
 public static SequenceInfo Read(FirebirdProcessor processor, string sequenceName)
 {
     using (DataSet ds = processor.Read(query, AdoHelper.FormatValue(sequenceName)))
     {
         return(new SequenceInfo(ds.Tables[0].Rows[0], processor));
     }
 }
Beispiel #5
0
 private SequenceInfo(DataRow drSequence, FirebirdProcessor processor)
 {
     Name = drSequence["rdb$generator_name"].ToString().Trim();
     using (DataSet ds = processor.Read(queryValue, Name))
     {
         CurrentValue = AdoHelper.GetIntValue(ds.Tables[0].Rows[0]["gen_val"]) ?? 0;
     }
 }
 public static IndexInfo Read(FirebirdProcessor processor, string indexName)
 {
     using (IDataReader ds = processor.Read(singleQuery, AdoHelper.FormatValue(indexName)))
     {
         ds.Read();
         return(new IndexInfo(ds, processor));
     }
 }
 private SequenceInfo(IDataReader drSequence, FirebirdProcessor processor)
 {
     Name = drSequence["rdb$generator_name"].ToString().Trim();
     using (IDataReader ds = processor.Read(queryValue, Name))
     {
         ds.Read();
         CurrentValue = AdoHelper.GetIntValue(ds["gen_val"]) ?? 0;
     }
 }
Beispiel #8
0
        public static SequenceInfo Read(FirebirdProcessor processor, string sequenceName, FirebirdQuoter quoter)
        {
            var fbSequenceName = quoter.ToFbObjectName(sequenceName);

            using (DataSet ds = processor.Read(query, AdoHelper.FormatValue(fbSequenceName)))
            {
                return(new SequenceInfo(ds.Tables[0].Rows[0], processor));
            }
        }
        public static SequenceInfo Read(FirebirdProcessor processor, string sequenceName)
        {
            var fbSequenceName = new FirebirdQuoter().ToFbObjectName(sequenceName);

            using (IDataReader ds = processor.Read(query, AdoHelper.FormatValue(fbSequenceName)))
            {
                ds.Read();
                return(new SequenceInfo(ds, processor));
            }
        }
Beispiel #10
0
 protected FirebirdProcessedExpressionBase(IMigrationExpression expression, Type expressionType, FirebirdProcessor processor)
 {
     Processor           = processor;
     Expression          = expression;
     this.expressionType = expressionType;
     if (processor.FBOptions.UndoEnabled && !processor.IsRunningOutOfMigrationScope())
     {
         SetupUndoExpressions();
     }
 }
Beispiel #11
0
        public static TableInfo Read(FirebirdProcessor processor, string tableName, FirebirdQuoter quoter)
        {
            var fbTableName = quoter.ToFbObjectName(tableName);
            var table       = processor.Read(query, AdoHelper.FormatValue(fbTableName)).Tables[0];

            if (table.Rows.Count == 0)
            {
                return(new TableInfo(tableName, false));
            }
            return(new TableInfo(table.Rows[0]));
        }
        public static TableInfo Read(FirebirdProcessor processor, string tableName)
        {
            var quoter      = new FirebirdQuoter();
            var fbTableName = quoter.ToFbObjectName(tableName);

            using (var dr = processor.Read(query, AdoHelper.FormatValue(fbTableName)))
            {
                dr.Read();
                return(new TableInfo(dr));
            }
        }
Beispiel #13
0
 public FirebirdTableSchema(string tableName, FirebirdProcessor processor)
 {
     TableName  = tableName;
     Processor  = processor;
     Definition = new TableDefinition()
     {
         Name       = tableName,
         SchemaName = String.Empty
     };
     Load();
 }
 public static List <ConstraintInfo> Read(FirebirdProcessor processor, TableInfo table)
 {
     using (DataSet ds = ((DataSetContainer)processor.Read(query, AdoHelper.FormatValue(table.Name))).DataSet)
     {
         List <ConstraintInfo> rows = new List <ConstraintInfo>();
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             rows.Add(new ConstraintInfo(dr, processor));
         }
         return(rows);
     }
 }
 public FirebirdTableSchema(string tableName, FirebirdProcessor processor, FirebirdQuoter quoter)
 {
     _quoter    = quoter;
     TableName  = tableName;
     Processor  = processor;
     Definition = new FirebirdTableDefinition()
     {
         Name       = tableName,
         SchemaName = String.Empty
     };
     Load();
 }
Beispiel #16
0
 public static List <TriggerInfo> Read(FirebirdProcessor processor, TableInfo table)
 {
     using (DataSet ds = processor.Read(query, AdoHelper.FormatValue(table.Name)))
     {
         List <TriggerInfo> rows = new List <TriggerInfo>();
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             rows.Add(new TriggerInfo(dr));
         }
         return(rows);
     }
 }
 public static List <TriggerInfo> Read(FirebirdProcessor processor, TableInfo table)
 {
     using (IDataReader ds = processor.Read(query, AdoHelper.FormatValue(table.Name)))
     {
         List <TriggerInfo> rows = new List <TriggerInfo>();
         while (ds.Read())
         {
             rows.Add(new TriggerInfo(ds, processor));
         }
         return(rows);
     }
 }
Beispiel #18
0
 private ColumnInfo(DataRow drColumn, FirebirdProcessor processor)
 {
     Name            = AdoHelper.GetStringValue(drColumn["field_name"]).Trim();
     TableName       = AdoHelper.GetStringValue(drColumn["relation_name"]).Trim();
     DefaultValue    = GetDefaultValue(drColumn["default_source"]);
     Position        = AdoHelper.GetIntValue(drColumn["field_position"]) ?? 0;
     IsNullable      = AdoHelper.GetIntValue(drColumn["null_flag"]) != 1;
     Precision       = AdoHelper.GetIntValue(drColumn["field_precision"]);
     CharacterLength = AdoHelper.GetIntValue(drColumn["field_character_length"]);
     FieldType       = AdoHelper.GetIntValue(drColumn["field_type"]);
     FieldSubType    = AdoHelper.GetIntValue(drColumn["field_sub_type"]);
     FieldTypeName   = AdoHelper.GetStringValue(drColumn["field_type_name"]).Trim();
 }
Beispiel #19
0
 private IndexInfo(DataRow drIndex, FirebirdProcessor processor)
 {
     Name        = drIndex["rdb$index_name"].ToString().Trim();
     TableName   = drIndex["rdb$relation_name"].ToString().Trim();
     IsUnique    = drIndex["rdb$unique_flag"].ToString().Trim() == "1";
     IsAscending = drIndex["rdb$index_type"].ToString().Trim() == "0";
     Columns     = new List <string>();
     using (DataSet dsColumns = processor.Read(indexFieldQuery, AdoHelper.FormatValue(Name)))
     {
         foreach (DataRow indexColumn in dsColumns.Tables[0].Rows)
         {
             Columns.Add(indexColumn["rdb$field_name"].ToString().Trim());
         }
     }
 }
 private IndexInfo(IDataReader drIndex, FirebirdProcessor processor)
 {
     Name        = drIndex["rdb$index_name"].ToString().Trim();
     TableName   = drIndex["rdb$relation_name"].ToString().Trim();
     IsUnique    = drIndex["rdb$unique_flag"].ToString().Trim() == "1";
     IsAscending = drIndex["rdb$index_type"].ToString().Trim() == "0";
     Columns     = new List <string>();
     using (IDataReader dsColumns = processor.Read(indexFieldQuery, AdoHelper.FormatValue(Name)))
     {
         while (dsColumns.Read())
         {
             Columns.Add(dsColumns["rdb$field_name"].ToString().Trim());
         }
     }
 }
Beispiel #21
0
        private ConstraintInfo(DataRow drConstraint, FirebirdProcessor processor)
        {
            Name         = drConstraint["rdb$constraint_name"].ToString().Trim();
            IsPrimaryKey = drConstraint["rdb$constraint_type"].ToString().Trim() == "PRIMARY KEY";
            IsNotNull    = drConstraint["rdb$constraint_type"].ToString().Trim() == "NOT NULL";
            IsForeignKey = drConstraint["rdb$constraint_type"].ToString().Trim() == "FOREIGN KEY";
            IsUnique     = drConstraint["rdb$constraint_type"].ToString().Trim() == "UNIQUE";
            IndexName    = drConstraint["rdb$index_name"].ToString().Trim();

            if (IsForeignKey)
            {
                using (DataSet dsForeign = processor.Read(colQuery, AdoHelper.FormatValue(Name)))
                {
                    DataRow drForeign = dsForeign.Tables[0].Rows[0];
                    ForeignIndex = IndexInfo.Read(processor, IndexName);
                    UpdateRule   = GetForeignRule(drForeign["rdb$update_rule"]);
                    DeleteRule   = GetForeignRule(drForeign["rdb$delete_rule"]);
                }
            }
        }
Beispiel #22
0
 public TableInfo(DataRow drMeta, FirebirdProcessor processor)
 {
     Name = drMeta["rdb$relation_name"].ToString().Trim();
 }
Beispiel #23
0
 public static TableInfo Read(FirebirdProcessor processor, string tableName)
 {
     return(new TableInfo(processor.Read(query, AdoHelper.FormatValue(tableName)).Tables[0].Rows[0], processor));
 }
Beispiel #24
0
 protected FirebirdProcessedExpressionBase(IMigrationExpression expression, Type expressionType, FirebirdProcessor processor)
 {
     Processor           = processor;
     Expression          = expression;
     this.expressionType = expressionType;
 }
Beispiel #25
0
 public FirebirdProcessedExpression(T expression, FirebirdProcessor processor)
     : base(expression, typeof(T), processor)
 {
 }
 public FirebirdSchemaProvider(FirebirdProcessor processor)
 {
     Processor = processor;
 }
Beispiel #27
0
 public FirebirdSchemaProvider(FirebirdProcessor processor, FirebirdQuoter quoter)
 {
     _quoter   = quoter;
     Processor = processor;
 }