Ejemplo n.º 1
0
        internal static void SetDSInfo(MyCatSchemaCollection sc)
        {
            // we use name indexing because this method will only be called
            // when GetSchema is called for the DataSourceInformation
            // collection and then it wil be cached.
            MyCatSchemaRow row = sc.AddRow();

            row["TypeName"]              = "FLOAT";
            row["ProviderDbType"]        = MyCatDbType.Float;
            row["ColumnSize"]            = 0;
            row["CreateFormat"]          = "FLOAT";
            row["CreateParameters"]      = null;
            row["DataType"]              = "System.Single";
            row["IsAutoincrementable"]   = false;
            row["IsBestMatch"]           = true;
            row["IsCaseSensitive"]       = false;
            row["IsFixedLength"]         = true;
            row["IsFixedPrecisionScale"] = true;
            row["IsLong"]               = false;
            row["IsNullable"]           = true;
            row["IsSearchable"]         = true;
            row["IsSearchableWithLike"] = false;
            row["IsUnsigned"]           = false;
            row["MaximumScale"]         = 0;
            row["MinimumScale"]         = 0;
            row["IsConcurrencyType"]    = DBNull.Value;
            row["IsLiteralSupported"]   = false;
            row["LiteralPrefix"]        = null;
            row["LiteralSuffix"]        = null;
            row["NativeDataType"]       = null;
        }
Ejemplo n.º 2
0
        internal static void SetDSInfo(MyCatSchemaCollection sc)
        {
            MyCatSchemaRow row = sc.AddRow();

            row["TypeName"]              = "JSON";
            row["ProviderDbType"]        = MyCatDbType.JSON;
            row["ColumnSize"]            = 0;
            row["CreateFormat"]          = "JSON";
            row["CreateParameters"]      = null;
            row["DataType"]              = "System.String";
            row["IsAutoincrementable"]   = false;
            row["IsBestMatch"]           = true;
            row["IsCaseSensitive"]       = false;
            row["IsFixedLength"]         = false;
            row["IsFixedPrecisionScale"] = true;
            row["IsLong"]               = false;
            row["IsNullable"]           = true;
            row["IsSearchable"]         = true;
            row["IsSearchableWithLike"] = true;
            row["IsUnsigned"]           = false;
            row["MaximumScale"]         = 0;
            row["MinimumScale"]         = 0;
            row["IsConcurrencyType"]    = DBNull.Value;
            row["IsLiteralSupported"]   = false;
            row["LiteralPrefix"]        = null;
            row["LiteralSuffix"]        = null;
            row["NativeDataType"]       = null;
        }
Ejemplo n.º 3
0
        internal static void SetDSInfo(MyCatSchemaCollection sc)
        {
            string[] types = new string[] { "CHAR", "NCHAR", "VARCHAR", "NVARCHAR", "SET",
                                            "ENUM", "TINYTEXT", "TEXT", "MEDIUMTEXT", "LONGTEXT" };
            MyCatDbType[] dbtype = new MyCatDbType[] { MyCatDbType.String, MyCatDbType.String,
                                                       MyCatDbType.VarChar, MyCatDbType.VarChar, MyCatDbType.Set, MyCatDbType.Enum,
                                                       MyCatDbType.TinyText, MyCatDbType.Text, MyCatDbType.MediumText,
                                                       MyCatDbType.LongText };

            // we use name indexing because this method will only be called
            // when GetSchema is called for the DataSourceInformation
            // collection and then it wil be cached.
            for (int x = 0; x < types.Length; x++)
            {
                MyCatSchemaRow row = sc.AddRow();
                row["TypeName"]              = types[x];
                row["ProviderDbType"]        = dbtype[x];
                row["ColumnSize"]            = 0;
                row["CreateFormat"]          = x < 4 ? types[x] + "({0})" : types[x];
                row["CreateParameters"]      = x < 4 ? "size" : null;
                row["DataType"]              = "System.String";
                row["IsAutoincrementable"]   = false;
                row["IsBestMatch"]           = true;
                row["IsCaseSensitive"]       = false;
                row["IsFixedLength"]         = false;
                row["IsFixedPrecisionScale"] = true;
                row["IsLong"]               = false;
                row["IsNullable"]           = true;
                row["IsSearchable"]         = true;
                row["IsSearchableWithLike"] = true;
                row["IsUnsigned"]           = false;
                row["MaximumScale"]         = 0;
                row["MinimumScale"]         = 0;
                row["IsConcurrencyType"]    = DBNull.Value;
                row["IsLiteralSupported"]   = false;
                row["LiteralPrefix"]        = null;
                row["LiteralSuffix"]        = null;
                row["NativeDataType"]       = null;
            }
        }
        public static void SetDSInfo(MyCatSchemaCollection sc)
        {
            string[]      types  = new string[] { "BLOB", "TINYBLOB", "MEDIUMBLOB", "LONGBLOB", "BINARY", "VARBINARY" };
            MyCatDbType[] dbtype = new MyCatDbType[] { MyCatDbType.Blob,
                                                       MyCatDbType.TinyBlob, MyCatDbType.MediumBlob, MyCatDbType.LongBlob, MyCatDbType.Binary, MyCatDbType.VarBinary };
            long[]   sizes  = new long[] { 65535L, 255L, 16777215L, 4294967295L, 255L, 65535L };
            string[] format = new string[] { null, null, null, null, "binary({0})", "varbinary({0})" };
            string[] parms  = new string[] { null, null, null, null, "length", "length" };

            // we use name indexing because this method will only be called
            // when GetSchema is called for the DataSourceInformation
            // collection and then it wil be cached.
            for (int x = 0; x < types.Length; x++)
            {
                MyCatSchemaRow row = sc.AddRow();
                row["TypeName"]              = types[x];
                row["ProviderDbType"]        = dbtype[x];
                row["ColumnSize"]            = sizes[x];
                row["CreateFormat"]          = format[x];
                row["CreateParameters"]      = parms[x];
                row["DataType"]              = "System.Byte[]";
                row["IsAutoincrementable"]   = false;
                row["IsBestMatch"]           = true;
                row["IsCaseSensitive"]       = false;
                row["IsFixedLength"]         = x < 4 ? false : true;
                row["IsFixedPrecisionScale"] = false;
                row["IsLong"]               = sizes[x] > 255;
                row["IsNullable"]           = true;
                row["IsSearchable"]         = false;
                row["IsSearchableWithLike"] = false;
                row["IsUnsigned"]           = DBNull.Value;
                row["MaximumScale"]         = DBNull.Value;
                row["MinimumScale"]         = DBNull.Value;
                row["IsConcurrencyType"]    = DBNull.Value;
                row["IsLiteralSupported"]   = false;
                row["LiteralPrefix"]        = "0x";
                row["LiteralSuffix"]        = DBNull.Value;
                row["NativeDataType"]       = DBNull.Value;
            }
        }
Ejemplo n.º 5
0
        internal static void SetDSInfo(MyCatSchemaCollection sc)
        {
            string[]      types  = new string[] { "INT", "YEAR", "MEDIUMINT" };
            MyCatDbType[] dbtype = new MyCatDbType[] { MyCatDbType.Int32,
                                                       MyCatDbType.Year, MyCatDbType.Int24 };

            // we use name indexing because this method will only be called
            // when GetSchema is called for the DataSourceInformation
            // collection and then it wil be cached.
            for (int x = 0; x < types.Length; x++)
            {
                MyCatSchemaRow row = sc.AddRow();
                row["TypeName"]              = types[x];
                row["ProviderDbType"]        = dbtype[x];
                row["ColumnSize"]            = 0;
                row["CreateFormat"]          = types[x];
                row["CreateParameters"]      = null;
                row["DataType"]              = "System.Int32";
                row["IsAutoincrementable"]   = dbtype[x] == MyCatDbType.Year ? false : true;
                row["IsBestMatch"]           = true;
                row["IsCaseSensitive"]       = false;
                row["IsFixedLength"]         = true;
                row["IsFixedPrecisionScale"] = true;
                row["IsLong"]               = false;
                row["IsNullable"]           = true;
                row["IsSearchable"]         = true;
                row["IsSearchableWithLike"] = false;
                row["IsUnsigned"]           = false;
                row["MaximumScale"]         = 0;
                row["MinimumScale"]         = 0;
                row["IsConcurrencyType"]    = DBNull.Value;
                row["IsLiteralSupported"]   = false;
                row["LiteralPrefix"]        = null;
                row["LiteralSuffix"]        = null;
                row["NativeDataType"]       = null;
            }
        }