public PostgresSqlDataTypeProvider(ConstraintDefaults constraintDefaults, bool nativeUuids, bool nativeEnums) : base(constraintDefaults) { this.NativeUuids = nativeUuids; this.NativeEnums = nativeEnums; this.blobSqlDataType = new DefaultBlobSqlDataType(constraintDefaults, "BYTEA"); this.DefineSqlDataType(typeof(bool), "BOOLEAN", "GetBoolean"); this.DefineSqlDataType(typeof(short), "SMALLINT", "GetInt16"); this.DefineSqlDataType(typeof(int), "INTEGER", "GetInt32"); this.DefineSqlDataType(typeof(ushort), "SMALLINT", "GetUInt16"); this.DefineSqlDataType(typeof(uint), "INTEGER", "GetUInt32"); this.DefineSqlDataType(typeof(ulong), "BIGINT", "GetUInt64"); this.DefineSqlDataType(typeof(double), "DOUBLE PRECISION", "GetDouble"); this.DefineSqlDataType(typeof(byte), "SMALLINT", "GetByte"); this.DefineSqlDataType(typeof(sbyte), "SMALLINT", "GetByte"); this.DefineSqlDataType(typeof(decimal), "NUMERIC(57, 28)", "GetDecimal"); this.DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "TIMESTAMP", false)); this.DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "TIMESTAMP", true)); this.DefineSqlDataType(new PostgresTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan))); this.DefineSqlDataType(new PostgresTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan?))); if (nativeUuids) { this.DefineSqlDataType(new PostgresUuidSqlDataType(this.ConstraintDefaults, typeof(Guid))); this.DefineSqlDataType(new PostgresUuidSqlDataType(this.ConstraintDefaults, typeof(Guid?))); } }
public DefaultSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { this.sqlDataTypesByType = new Dictionary <Type, SqlDataType>(PrimeNumbers.Prime43); this.DefineSqlDataType(typeof(bool), "TINYINT", "GetBoolean"); this.DefineSqlDataType(typeof(byte), "BYTE UNSIGNED ", "GetByte"); this.DefineSqlDataType(typeof(sbyte), "BYTE", "GetByte"); this.DefineSqlDataType(typeof(char), "CHAR", "GetChar"); this.DefineSqlDataType(typeof(int), "INT", "GetInt32"); this.DefineSqlDataType(typeof(uint), "INT UNSIGNED ", "GetUInt32"); this.DefineSqlDataType(typeof(short), "SMALLINT", "GetInt16"); this.DefineSqlDataType(typeof(ushort), "SMALLINT UNSIGNED ", "GetUInt16"); this.DefineSqlDataType(typeof(long), "BIGINT", "GetInt64"); this.DefineSqlDataType(typeof(ulong), "BIGINT UNSIGNED", "GetUInt64"); this.DefineSqlDataType(typeof(DateTime), "DATETIME", "GetDateTime"); this.DefineSqlDataType(typeof(float), "FLOAT", "GetFloat"); this.DefineSqlDataType(typeof(double), "DOUBLE", "GetDouble"); this.DefineSqlDataType(typeof(decimal), "NUMERIC", "GetDecimal"); this.DefineSqlDataType(new DefaultGuidSqlDataType(this.ConstraintDefaults, typeof(Guid))); this.DefineSqlDataType(new DefaultGuidSqlDataType(this.ConstraintDefaults, typeof(Guid?))); this.DefineSqlDataType(new DefaultTimeSpanSqlDataType(this, this.ConstraintDefaults, typeof(TimeSpan))); this.DefineSqlDataType(new DefaultTimeSpanSqlDataType(this, this.ConstraintDefaults, typeof(TimeSpan?))); this.DefineSqlDataType(new DefaultStringSqlDataType(this.ConstraintDefaults)); }
protected SqlDataType(ConstraintDefaults constraintDefaults, Type supportedType, bool isUserDefinedType) { this.constraintDefaults = constraintDefaults; this.SupportedType = supportedType; this.IsUserDefinedType = isUserDefinedType; this.UnderlyingType = Nullable.GetUnderlyingType(supportedType); }
public DefaultSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { sqlDataTypesByType = new Dictionary<Type, SqlDataType>(PrimeNumbers.Prime43); DefineSqlDataType(typeof(bool), "TINYINT", "GetBoolean"); DefineSqlDataType(typeof(byte), "BYTE UNSIGNED ", "GetByte"); DefineSqlDataType(typeof(sbyte), "BYTE", "GetByte"); DefineSqlDataType(typeof(char), "CHAR", "GetChar"); DefineSqlDataType(typeof(int), "INT", "GetInt32"); DefineSqlDataType(typeof(uint), "INT UNSIGNED ", "GetUInt32"); DefineSqlDataType(typeof(short), "SMALLINT", "GetInt16"); DefineSqlDataType(typeof(ushort), "SMALLINT UNSIGNED ", "GetUInt16"); DefineSqlDataType(typeof(long), "BIGINT", "GetInt64"); DefineSqlDataType(typeof(ulong), "BIGINT UNSIGNED", "GetUInt64"); DefineSqlDataType(typeof(DateTime), "DATETIME", "GetDateTime"); DefineSqlDataType(typeof(float), "FLOAT", "GetFloat"); DefineSqlDataType(typeof(double), "DOUBLE", "GetDouble"); DefineSqlDataType(typeof(decimal), "NUMERIC", "GetDecimal"); DefineSqlDataType(new DefaultGuidSqlDataType(this.ConstraintDefaults, typeof(Guid))); DefineSqlDataType(new DefaultGuidSqlDataType(this.ConstraintDefaults, typeof(Guid?))); DefineSqlDataType(new DefaultTimeSpanSqlDataType(this, this.ConstraintDefaults, typeof(TimeSpan))); DefineSqlDataType(new DefaultTimeSpanSqlDataType(this, this.ConstraintDefaults, typeof(TimeSpan?))); DefineSqlDataType(new DefaultStringSqlDataType(this.ConstraintDefaults)); }
protected SqlDataType(ConstraintDefaults constraintDefaults, Type supportedType, bool isUserDefinedType) { this.constraintDefaults = constraintDefaults; this.SupportedType = supportedType; this.IsUserDefinedType = isUserDefinedType; this.UnderlyingType = Nullable.GetUnderlyingType(supportedType); }
public PostgresSharedSqlDataTypeProvider(ConstraintDefaults constraintDefaults, bool nativeUuids, bool nativeEnums) : base(constraintDefaults) { this.NativeUuids = nativeUuids; this.NativeEnums = nativeEnums; this.blobSqlDataType = new DefaultBlobSqlDataType(constraintDefaults, "BYTEA"); DefineSqlDataType(typeof(bool), "BOOLEAN", "GetBoolean"); DefineSqlDataType(typeof(short), "SMALLINT", "GetInt16"); DefineSqlDataType(typeof(int), "INTEGER", "GetInt32"); DefineSqlDataType(typeof(ushort), "SMALLINT", "GetUInt16"); DefineSqlDataType(typeof(uint), "INTEGER", "GetUInt32"); DefineSqlDataType(typeof(ulong), "BIGINT", "GetUInt64"); DefineSqlDataType(typeof(double), "DOUBLE PRECISION", "GetDouble"); DefineSqlDataType(typeof(byte), "SMALLINT", "GetByte"); DefineSqlDataType(typeof(sbyte), "SMALLINT", "GetByte"); DefineSqlDataType(typeof(decimal), "NUMERIC(57, 28)", "GetDecimal"); DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "TIMESTAMP", false)); DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "TIMESTAMP", true)); DefineSqlDataType(new PostgresSharedTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan))); DefineSqlDataType(new PostgresSharedTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan?))); if (nativeUuids) { DefineSqlDataType(new PostgresSharedUuidSqlDataType(this.ConstraintDefaults, typeof(Guid))); DefineSqlDataType(new PostgresSharedUuidSqlDataType(this.ConstraintDefaults, typeof(Guid?))); } }
public PostgresDotConnectSqlDataTypeProvider(ConstraintDefaults constraintDefaults, bool nativeUuids, bool nativeEnums, bool objectTimespans) : base(constraintDefaults, nativeUuids, nativeEnums) { if (objectTimespans) { DefineSqlDataType(new PostgresDotConnectObjectTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan))); DefineSqlDataType(new PostgresDotConnectObjectTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan?))); } }
public PostgresDotConnectSqlDataTypeProvider(ConstraintDefaults constraintDefaults, bool nativeUuids, bool nativeEnums, bool objectTimespans) : base(constraintDefaults, nativeUuids, nativeEnums) { if (objectTimespans) { DefineSqlDataType(new PostgresDotConnectObjectTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan))); DefineSqlDataType(new PostgresDotConnectObjectTimespanSqlDataType(this.ConstraintDefaults, typeof(TimeSpan?))); } }
public MySqlSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { DefineSqlDataType(typeof(byte), "TINYINT UNSIGNED", "GetByte"); DefineSqlDataType(typeof(sbyte), "TINYINT", "GetByte"); DefineSqlDataType(typeof(decimal), "DECIMAL(60, 30)", "GetDecimal"); DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME", false)); DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME", true)); }
public MySqlSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { this.DefineSqlDataType(typeof(byte), "TINYINT UNSIGNED", "GetByte"); this.DefineSqlDataType(typeof(sbyte), "TINYINT", "GetByte"); this.DefineSqlDataType(typeof(decimal), "DECIMAL(60, 30)", "GetDecimal"); this.DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME", false)); this.DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME", true)); }
private static ConstraintDefaults CreateConstraintDefaults(ConstraintDefaults defaults, Type type) { var length = GetRecommendedLength(type); return(new ConstraintDefaults(defaults) { StringMaximumLength = length, IndexedStringMaximumLength = length, StringSizeFlexibility = SizeFlexibility.Variable }); }
public SqliteSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { DefineSqlDataType(typeof(byte), "INTEGER", "GetByte"); DefineSqlDataType(typeof(sbyte), "INTEGER", "GetByte"); DefineSqlDataType(typeof(char), "TEXT", "GetChar"); DefineSqlDataType(typeof(int), "INTEGER", "GetInt32"); DefineSqlDataType(typeof(uint), "INTEGER", "GetInt32"); DefineSqlDataType(typeof(short), "INTEGER", "GetInt16"); DefineSqlDataType(typeof(ushort), "INTEGER", "GetUInt16"); DefineSqlDataType(typeof(long), "INTEGER", "GetInt64"); DefineSqlDataType(typeof(ulong), "INTEGER BIGINT", "GetUInt64"); DefineSqlDataType(typeof(DateTime), "TEXT", "GetDateTime"); DefineSqlDataType(typeof(float), "REAL", "GetFloat"); DefineSqlDataType(typeof(double), "REAL", "GetDouble"); DefineSqlDataType(typeof(decimal), "TEXT", "GetDecimal"); }
public SqliteSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { this.DefineSqlDataType(typeof(byte), "INTEGER", "GetByte"); this.DefineSqlDataType(typeof(sbyte), "INTEGER", "GetByte"); this.DefineSqlDataType(typeof(char), "TEXT", "GetChar"); this.DefineSqlDataType(typeof(int), "INTEGER", "GetInt32"); this.DefineSqlDataType(typeof(uint), "INTEGER", "GetInt32"); this.DefineSqlDataType(typeof(short), "INTEGER", "GetInt16"); this.DefineSqlDataType(typeof(ushort), "INTEGER", "GetUInt16"); this.DefineSqlDataType(typeof(long), "INTEGER", "GetInt64"); this.DefineSqlDataType(typeof(ulong), "INTEGER BIGINT", "GetUInt64"); this.DefineSqlDataType(typeof(DateTime), "TEXT", "GetDateTime"); this.DefineSqlDataType(typeof(float), "REAL", "GetFloat"); this.DefineSqlDataType(typeof(double), "REAL", "GetDouble"); this.DefineSqlDataType(typeof(decimal), "TEXT", "GetDecimal"); }
public SqlServerSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { DefineSqlDataType(typeof(bool), "BIT", "GetBoolean"); DefineSqlDataType(typeof(byte), "TINYINT", "GetByte"); DefineSqlDataType(typeof(sbyte), "TINYINT", "GetByte"); DefineSqlDataType(typeof(char), "CHAR", "GetChar"); DefineSqlDataType(typeof(int), "INT", "GetInt32"); DefineSqlDataType(typeof(uint), "NUMERIC(10)", "GetUInt32"); DefineSqlDataType(typeof(short), "SMALLINT", "GetInt16"); DefineSqlDataType(typeof(ushort), "NUMERIC(5)", "GetUInt16"); DefineSqlDataType(typeof(long), "BIGINT", "GetInt64"); DefineSqlDataType(typeof(ulong), "NUMERIC(20)", "GetUInt64"); DefineSqlDataType(typeof(DateTime), "DATETIME2", "GetDateTime"); DefineSqlDataType(typeof(float), "FLOAT(24)", "GetFloat"); DefineSqlDataType(typeof(double), "FLOAT(53)", "GetDouble"); this.DefineSqlDataType(new SqlServerDecimalDataType(constraintDefaults, typeof(decimal), "DECIMAL(38, 9)")); this.DefineSqlDataType(new SqlServerDecimalDataType(constraintDefaults, typeof(decimal?), "DECIMAL(38, 9)")); }
public SqlServerSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { DefineSqlDataType(typeof(bool), "BIT", "GetBoolean"); DefineSqlDataType(typeof(byte), "TINYINT", "GetByte"); DefineSqlDataType(typeof(sbyte), "TINYINT", "GetByte"); DefineSqlDataType(typeof(char), "CHAR", "GetChar"); DefineSqlDataType(typeof(int), "INT", "GetInt32"); DefineSqlDataType(typeof(uint), "NUMERIC(10)", "GetUInt32"); DefineSqlDataType(typeof(short), "SMALLINT", "GetInt16"); DefineSqlDataType(typeof(ushort), "NUMERIC(5)", "GetUInt16"); DefineSqlDataType(typeof(long), "BIGINT", "GetInt64"); DefineSqlDataType(typeof(ulong), "NUMERIC(20)", "GetUInt64"); DefineSqlDataType(typeof(float), "FLOAT(24)", "GetFloat"); DefineSqlDataType(typeof(double), "FLOAT(53)", "GetDouble"); DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME2", false)); DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME2", true)); this.DefineSqlDataType(new SqlServerDecimalDataType(constraintDefaults, typeof(decimal), "DECIMAL(38, 9)")); this.DefineSqlDataType(new SqlServerDecimalDataType(constraintDefaults, typeof(decimal?), "DECIMAL(38, 9)")); }
public SqlServerSqlDataTypeProvider(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { this.DefineSqlDataType(typeof(bool), "BIT", "GetBoolean"); this.DefineSqlDataType(typeof(byte), "TINYINT", "GetByte"); this.DefineSqlDataType(typeof(sbyte), "TINYINT", "GetByte"); this.DefineSqlDataType(typeof(char), "CHAR", "GetChar"); this.DefineSqlDataType(typeof(int), "INT", "GetInt32"); this.DefineSqlDataType(typeof(uint), "NUMERIC(10)", "GetUInt32"); this.DefineSqlDataType(typeof(short), "SMALLINT", "GetInt16"); this.DefineSqlDataType(typeof(ushort), "NUMERIC(5)", "GetUInt16"); this.DefineSqlDataType(typeof(long), "BIGINT", "GetInt64"); this.DefineSqlDataType(typeof(ulong), "NUMERIC(20)", "GetUInt64"); this.DefineSqlDataType(typeof(float), "FLOAT(24)", "GetFloat"); this.DefineSqlDataType(typeof(double), "FLOAT(53)", "GetDouble"); this.DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME2", false)); this.DefineSqlDataType(new UniversalTimeNormalisingDateTimeSqlDateType(this.ConstraintDefaults, "DATETIME2", true)); this.DefineSqlDataType(new SqlServerDecimalDataType(constraintDefaults, typeof(decimal), "DECIMAL(38, 9)")); this.DefineSqlDataType(new SqlServerDecimalDataType(constraintDefaults, typeof(decimal?), "DECIMAL(38, 9)")); this.DefineSqlDataType(new DefaultBlobSqlDataType(constraintDefaults, "VARBINARY(MAX)")); this.DefineSqlDataType(new SqlServerStringSqlDataType(constraintDefaults)); }
public PrimitiveSqlDataType(ConstraintDefaults constraintDefaults, Type type, string sqlName, MethodInfo getMethod) : base(constraintDefaults, type) { this.SqlName = sqlName; this.GetMethod = getMethod; }
public SqlServerStringSqlDataType(ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { }
protected SqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : this(constraintDefaults, supportedType, false) { }
public SqlServerDecimalDataType(ConstraintDefaults constraintDefaults, Type type, string sqlName) : base(constraintDefaults, type) { this.SqlName = sqlName; this.method = this.GetType().GetMethod("Read", BindingFlags.Public | BindingFlags.Static); }
protected SqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : this(constraintDefaults, supportedType, false) { }
public DefaultBlobSqlDataType(ConstraintDefaults constraintDefaults, string sqlName) : base(constraintDefaults, typeof(byte[])) { this.sqlName = sqlName; }
public PostgresDotConnectTimespanSqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : base(constraintDefaults, supportedType) { }
public SqlServerDecimalDataType(ConstraintDefaults constraintDefaults, Type type, string sqlName) : base(constraintDefaults, type) { this.SqlName = sqlName; this.method = this.GetType().GetMethod("Read", BindingFlags.Public | BindingFlags.Static); }
public PostgresSharedUuidSqlDataType(ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { }
public SqlServerStringSqlDataType(ConstraintDefaults constraintDefaults) : base(constraintDefaults) { }
public UniversalTimeNormalisingDateTimeSqlDateType(ConstraintDefaults constraintDefaults, string typeName, bool nullable) : base(constraintDefaults, nullable ? typeof(DateTime?) : typeof(DateTime), typeName, DataRecordMethods.GetMethod("GetDateTime")) { this.specifyKindMethod = nullable ? specifyKindIfUnspecifiedMethodNullable : specifyKindIfUnspecifiedMethod; }
public DefaultTimeSpanSqlDataType(SqlDataTypeProvider sqlDataTypeProvider, ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { this.sqlDataTypeProvider = sqlDataTypeProvider; }
public UniversalTimeNormalisingDateTimeSqlDateType(ConstraintDefaults constraintDefaults, string typeName, bool nullable) : base(constraintDefaults, nullable ? typeof(DateTime?) : typeof(DateTime), typeName, DataRecordMethods.GetMethod("GetDateTime")) { this.specifyKindMethod = nullable ? specifyKindIfUnspecifiedMethodNullable : specifyKindIfUnspecifiedMethod; }
public PostgresSharedEnumSqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : base(constraintDefaults, supportedType) { underlyingType = Nullable.GetUnderlyingType(supportedType); }
public PostgresTimespanSqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : base(constraintDefaults, supportedType) { this.underlyingType = Nullable.GetUnderlyingType(supportedType); }
public DefaultGuidSqlDataType(ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { }
protected SqlDataTypeProvider(ConstraintDefaults constraintDefaults) { this.ConstraintDefaults = constraintDefaults; }
protected DefaultStringSqlDataType(ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { }
public PostgresSharedEnumSqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : base(constraintDefaults, supportedType) { underlyingType = Nullable.GetUnderlyingType(supportedType); }
public PostgresSharedUuidSqlDataType(ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { }
protected DefaultStringSqlDataType(ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { }
public DefaultGuidSqlDataType(ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { }
public DefaultStringSqlDataType(ConstraintDefaults constraintDefaults) : base(constraintDefaults, typeof(string)) { }
public DefaultTimeSpanSqlDataType(SqlDataTypeProvider sqlDataTypeProvider, ConstraintDefaults constraintDefaults, Type type) : base(constraintDefaults, type) { this.sqlDataTypeProvider = sqlDataTypeProvider; }
public PostgresDotConnectObjectTimespanSqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : base(constraintDefaults, supportedType) { }
public PostgresTimespanSqlDataType(ConstraintDefaults constraintDefaults, Type supportedType) : base(constraintDefaults, supportedType) { this.underlyingType = Nullable.GetUnderlyingType(supportedType); }
public DefaultStringEnumSqlDataType(ConstraintDefaults constraintDefaults) : base(CreateConstraintDefaults(constraintDefaults, typeof(T)), typeof(T)) { }
public DefaultStringSqlDataType(ConstraintDefaults constraintDefaults) : base(constraintDefaults, typeof(string)) { }
public DefaultBlobSqlDataType(ConstraintDefaults constraintDefaults, string sqlName) : base(constraintDefaults, typeof(byte[])) { this.sqlName = sqlName; }
protected SqlDataTypeProvider(ConstraintDefaults constraintDefaults) { this.ConstraintDefaults = constraintDefaults; }