|
4 | 4 | using System.Data; |
5 | 5 | using AdoNet.Specification.Tests; |
6 | 6 |
|
7 | | -namespace AdoNet.Databases |
| 7 | +namespace AdoNet.Databases; |
| 8 | + |
| 9 | +public static class MySqlDatabase |
8 | 10 | { |
9 | | -public static class MySqlDatabase |
| 11 | +public static void CreateSelectValueTable(IDbFactoryFixture factoryFixture) |
10 | 12 | { |
11 | | -public static void CreateSelectValueTable(IDbFactoryFixture factoryFixture) |
12 | | -{ |
13 | | -Utility.ExecuteNonQuery(factoryFixture, @"drop table if exists select_value; |
| 13 | +Utility.ExecuteNonQuery(factoryFixture, @"drop table if exists select_value; |
14 | 14 | create table select_value |
15 | 15 | ( |
16 | 16 | Id int not null primary key, |
@@ -41,40 +41,39 @@ insert into select_value values |
41 | 41 | (4, null, false, 0, -128, -32768, 0, -2147483648, 0, -9223372036854775808, 0, 1.18e-38, 2.23e-308, 0.000000000000001, null, '33221100-5544-7766-9988-aabbccddeeff', '1000-01-01', '1000-01-01 00:00:00', '-838:59:59'), |
42 | 42 | (5, null, true, 255, 127, 32767, 65535, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615, 3.40e38, 1.79e308, 99999999999999999999.999999999999999, null, 'ccddeeff-aabb-8899-7766-554433221100', '9999-12-31', '9999-12-31 23:59:59.999', '838:59:59'); |
43 | 43 | "); |
44 | | -} |
| 44 | +} |
45 | 45 |
|
46 | | -public static void DropSelectValueTable(IDbFactoryFixture factoryFixture) => Utility.ExecuteNonQuery(factoryFixture, "drop table if exists select_value;"); |
| 46 | +public static void DropSelectValueTable(IDbFactoryFixture factoryFixture) => Utility.ExecuteNonQuery(factoryFixture, "drop table if exists select_value;"); |
47 | 47 |
|
48 | | -public static string CreateSelectSql(DbType dbType, ValueKind kind) => $"SELECT `{dbType.ToString()}` from select_value WHERE Id = {(int) kind};"; |
| 48 | +public static string CreateSelectSql(DbType dbType, ValueKind kind) => $"SELECT `{dbType.ToString()}` from select_value WHERE Id = {(int) kind};"; |
49 | 49 |
|
50 | | -public static string CreateSelectSql(byte[] value) => $"SELECT X'{BitConverter.ToString(value).Replace("-", "")}'"; |
| 50 | +public static string CreateSelectSql(byte[] value) => $"SELECT X'{BitConverter.ToString(value).Replace("-", "")}'"; |
51 | 51 |
|
52 | | -public static string SelectNoRows => "SELECT * FROM mysql.user WHERE 0 = 1;"; |
| 52 | +public static string SelectNoRows => "SELECT * FROM mysql.user WHERE 0 = 1;"; |
53 | 53 |
|
54 | | -public static string DeleteNoRows => "DELETE FROM select_value WHERE 0 = 1;"; |
| 54 | +public static string DeleteNoRows => "DELETE FROM select_value WHERE 0 = 1;"; |
55 | 55 |
|
56 | | -public static IReadOnlyCollection<DbType> SupportedDbTypes { get; } = new ReadOnlyCollection<DbType>(new[] |
57 | | -{ |
58 | | -DbType.Binary, |
59 | | -DbType.Boolean, |
60 | | -DbType.Byte, |
61 | | -DbType.Date, |
62 | | -DbType.DateTime, |
63 | | -DbType.Decimal, |
64 | | -DbType.Double, |
65 | | -DbType.Guid, |
66 | | -DbType.Int16, |
67 | | -DbType.Int32, |
68 | | -DbType.Int64, |
69 | | -DbType.SByte, |
70 | | -DbType.Single, |
71 | | -DbType.String, |
72 | | -DbType.Time, |
73 | | -DbType.UInt16, |
74 | | -DbType.UInt32, |
75 | | -DbType.UInt64, |
76 | | -}); |
| 56 | +public static IReadOnlyCollection<DbType> SupportedDbTypes { get; } = new ReadOnlyCollection<DbType>(new[] |
| 57 | +{ |
| 58 | +DbType.Binary, |
| 59 | +DbType.Boolean, |
| 60 | +DbType.Byte, |
| 61 | +DbType.Date, |
| 62 | +DbType.DateTime, |
| 63 | +DbType.Decimal, |
| 64 | +DbType.Double, |
| 65 | +DbType.Guid, |
| 66 | +DbType.Int16, |
| 67 | +DbType.Int32, |
| 68 | +DbType.Int64, |
| 69 | +DbType.SByte, |
| 70 | +DbType.Single, |
| 71 | +DbType.String, |
| 72 | +DbType.Time, |
| 73 | +DbType.UInt16, |
| 74 | +DbType.UInt32, |
| 75 | +DbType.UInt64, |
| 76 | +}); |
77 | 77 |
|
78 | | -public static Type NullValueExceptionType => typeof(InvalidCastException); |
79 | | -} |
| 78 | +public static Type NullValueExceptionType => typeof(InvalidCastException); |
80 | 79 | } |
0 commit comments