Exemple #1
0
        public DbColumn(MetaContext context, DbTableName table, DataRow row)
            : base(context)
        {
            BaseColumnRef = new DbColumnName(context)
            {
                Name = row.GetValue<string>("BaseColumnName"),
                TableRef = new DbTableName(context)
                {
                    Catalog = row.GetValue<string>("BaseCatalogName"),
                    Name = row.GetValue<string>("BaseTableName"),
                    Schema = row.GetValue<string>("BaseSchemaName")
                }
            };

            Name = row.GetValue<string>("ColumnName");
            TableRef = table;

            AllowDBNull = row.GetValue<bool>("AllowDBNull");
            ColumnOrdinal = row.GetValue<int>("ColumnOrdinal");
            ColumnSize = row.GetValue<int>("ColumnSize");
            DataType = row.GetValue<Type>("DataType");
            IsAutoIncrement = row.GetValue<bool>("IsAutoIncrement");
            IsKey = row.GetValue<bool>("IsKey");
            IsLong = row.GetValue<bool>("IsLong");
            IsHidden = row.GetValue<bool>("IsHidden");
            IsReadOnly = row.GetValue<bool>("IsReadOnly");
            IsRowVersion = row.GetValue<bool>("IsRowVersion");
            IsUnique = row.GetValue<bool>("IsUnique");
            NumericPrecision = row.GetValue<int>("NumericPrecision");
            NumericScale = row.GetValue<int>("NumericScale");
            ProviderType = row.GetValue<string>("ProviderType");
            DataTypeName = row.GetValue<string>("DataTypeName");
        }
Exemple #2
0
 public DbTable(MetaContext context, DataRow row)
     : base(context)
 {
     this.Catalog = row.GetValue<string>("TABLE_CATALOG");
     this.Schema = row.GetValue<string>("TABLE_SCHEMA");
     this.Name = row.GetValue<string>("TABLE_NAME");
     this.TableType = row.GetValue<string>("TABLE_TYPE");
 }
Exemple #3
0
        public DbRelation(MetaContext context, DataRow row)
            : base(context)
        {
            PkColumnRef = GetColumnInfo(context, row, "PK");
            PkOrdinalPosition = row.GetValue<int>("PK_ORDINAL_POSITION");

            FkColumnRef = GetColumnInfo(context, row, "FK");
            FkOrdinalPosition = row.GetValue<int>("FK_ORDINAL_POSITION");

            Name = row.GetValue<string>("FK_NAME");
        }
Exemple #4
0
        public DbForeignKey(MetaContext context, IList<DbRelation> columns)
            : base(context)
        {
            this.Columns = columns;

            var first = columns.First();
            this.Name = first.Name;
            this.PkTableRef = first.PkColumnRef.TableRef;
            this.FkTableRef = first.FkColumnRef.TableRef;
            this.SafeNaming = true;
        }
Exemple #5
0
 private DbColumnName GetColumnInfo(MetaContext context, DataRow row, string type)
 {
     return new DbColumnName(context)
     {
         Name = row.GetValue<string>(type + "_COLUMN_NAME"),
         TableRef = new DbTableName(context)
         {
             Name = row.GetValue<string>(type + "_TABLE_NAME"),
             Schema = row.GetValue<string>(type + "_TABLE_SCHEMA"),
             Catalog = row.GetValue<string>(type + "_TABLE_CATALOG")
         }
     };
 }
Exemple #6
0
 public DbForeignKeyName(MetaContext context)
     : base(context)
 {
 }
Exemple #7
0
 public DbOneToMany(MetaContext context, IList<DbRelation> columns)
     : base(context, columns)
 {
 }
Exemple #8
0
 public DbManyToOne(MetaContext context, IList<DbRelation> columns)
     : base(context, columns)
 {
 }
 public SqlServerCeSchemaProvider(MetaContext context)
     : base(context)
 {
 }
 public ContextualizedObject(MetaContext context)
 {
     this.Context = context;
 }
Exemple #11
0
 public DbTableName(MetaContext context, string name)
     : base(context)
 {
     var parts = name.Split('.').Reverse().ToList();
     if (parts.Count > 0) Name = parts[0];
     if (parts.Count > 1) Schema = parts[1];
     if (parts.Count > 2) Catalog = parts[2];
 }
Exemple #12
0
 public DbTableName(MetaContext context)
     : base(context)
 {
 }
Exemple #13
0
 public DbColumnName(MetaContext context)
     : base(context)
 {
 }
Exemple #14
0
 public DbRelationName(MetaContext context)
     : base(context)
 {
 }
 public OracleSchemaProvider(MetaContext context)
     : base(context)
 {
 }
 public SQLiteSchemaProvider(MetaContext context)
     : base(context)
 {
 }
 public PostgreSqlSchemaProvider(MetaContext context)
     : base(context)
 {
 }