public PostgresqlType(string postgresqlColumnType, string infoSchemaName, NpgsqlDbType postgresqlDbType, DbType databaseType, MungTypeCode code)
 {
     InfoSchemaName = infoSchemaName;
     CreateColumnDefinition = postgresqlColumnType;
     PostgresqlDbType = postgresqlDbType;
     DatabaseType = databaseType;
     MungType = MungType.Get(code);
 }
 public override string GetCreateColumnDefinition(MungType type)
 {
     var t = Types.FirstOrDefault(x => x.MungType == type);
     if (t == null) {
         throw new InvalidOperationException($"MungType for {type.DotNetType} is unknown to SqlServerTypeConverter");
     }
     return t.CreateColumnDefinition;
 }
        public static PostgresqlType Get(MungType type)
        {
            var t = Types.FirstOrDefault(p => p.MungType.Code == type.Code);
            if (t == null) {
                throw new Exception($"Unable to find PostgresqlType for: '{type.Code.ToString()}' ({type.DotNetType})");
            }

            return t;
        }
Ejemplo n.º 4
0
 public abstract string GetCreateColumnDefinition(MungType type);
Ejemplo n.º 5
0
 public DbColumn(string name, MungType type)
 {
     ColumnName = name.ToLower();
     MungType = type;
 }
Ejemplo n.º 6
0
 public DbColumn(string name, Type type)
 {
     ColumnName = name.ToLower();
     MungType = MungType.Get(type);
 }
 public override string GetCreateColumnDefinition(MungType type)
 {
     var t = Get(type);
     if (t == null) {
         throw new InvalidOperationException($"MungType for {type.DotNetType} is unknown to PostgresqlDbTypeConverter");
     }
     return t.CreateColumnDefinition;
 }
 public SqlServerType(MungType mt, string infoSchemaName, string columnDefinition)
 {
     MungType = mt;
     InfoSchemaName = infoSchemaName;
     CreateColumnDefinition = columnDefinition;
 }