@@ -21,7 +21,7 @@ public async Task PostgresqlTableExistScriptTest_Success()
21
21
{
22
22
new DatabaseScript (
23
23
"mytable" ,
24
- $@ "SELECT EXISTS (SELECT * FROM information_schema. tables WHERE table_name = 'mytable');",
24
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" tables"" WHERE "" table_name"" = 'mytable');",
25
25
DatabaseTestType . ObjectExist ,
26
26
DatabaseKind . PostgreSQL )
27
27
} . ToExpectedObject ( ) ;
@@ -42,7 +42,7 @@ public async Task PostgresqlViewExistScriptTest_Success()
42
42
{
43
43
new DatabaseScript (
44
44
"myview" ,
45
- $@ "SELECT EXISTS (SELECT * FROM information_schema. views WHERE table_name = 'myview');",
45
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" views"" WHERE "" table_name"" = 'myview');",
46
46
DatabaseTestType . ObjectExist ,
47
47
DatabaseKind . PostgreSQL )
48
48
} . ToExpectedObject ( ) ;
@@ -63,7 +63,7 @@ public async Task PostgresqlStoredProcedureExistScriptTest_Success()
63
63
{
64
64
new DatabaseScript (
65
65
"mystoredprocedure" ,
66
- $@ "SELECT EXISTS (SELECT * FROM information_schema. routines WHERE routine_name = 'mystoredprocedure');",
66
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" routines"" WHERE "" routine_name"" = 'mystoredprocedure');",
67
67
DatabaseTestType . ObjectExist ,
68
68
DatabaseKind . PostgreSQL )
69
69
} . ToExpectedObject ( ) ;
@@ -84,12 +84,12 @@ public async Task PostgresqlMultipleTableExistScriptTest_Success()
84
84
{
85
85
new DatabaseScript (
86
86
"table1" ,
87
- $@ "SELECT EXISTS (SELECT * FROM information_schema. tables WHERE table_name = 'table1');",
87
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" tables"" WHERE "" table_name"" = 'table1');",
88
88
DatabaseTestType . ObjectExist ,
89
89
DatabaseKind . PostgreSQL ) ,
90
90
new DatabaseScript (
91
91
"table2" ,
92
- $@ "SELECT EXISTS (SELECT * FROM information_schema. tables WHERE table_name = 'table2');",
92
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" tables"" WHERE "" table_name"" = 'table2');",
93
93
DatabaseTestType . ObjectExist ,
94
94
DatabaseKind . PostgreSQL )
95
95
} . ToExpectedObject ( ) ;
@@ -110,12 +110,12 @@ public async Task PostgresqlMultipleViewExistScriptTest_Success()
110
110
{
111
111
new DatabaseScript (
112
112
"view1" ,
113
- $@ "SELECT EXISTS (SELECT * FROM information_schema. views WHERE table_name = 'view1');",
113
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" views"" WHERE "" table_name"" = 'view1');",
114
114
DatabaseTestType . ObjectExist ,
115
115
DatabaseKind . PostgreSQL ) ,
116
116
new DatabaseScript (
117
117
"view2" ,
118
- $@ "SELECT EXISTS (SELECT * FROM information_schema. views WHERE table_name = 'view2');",
118
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" views"" WHERE "" table_name"" = 'view2');",
119
119
DatabaseTestType . ObjectExist ,
120
120
DatabaseKind . PostgreSQL )
121
121
} . ToExpectedObject ( ) ;
@@ -136,12 +136,12 @@ public async Task PostgresqlMultipleStoredProcedureExistScriptTest_Success()
136
136
{
137
137
new DatabaseScript (
138
138
"sp1" ,
139
- $@ "SELECT EXISTS (SELECT * FROM information_schema. routines WHERE routine_name = 'sp1');",
139
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" routines"" WHERE "" routine_name"" = 'sp1');",
140
140
DatabaseTestType . ObjectExist ,
141
141
DatabaseKind . PostgreSQL ) ,
142
142
new DatabaseScript (
143
143
"sp2" ,
144
- $@ "SELECT EXISTS (SELECT * FROM information_schema. routines WHERE routine_name = 'sp2');",
144
+ $@ "SELECT EXISTS(SELECT * FROM "" information_schema""."" routines"" WHERE "" routine_name"" = 'sp2');",
145
145
DatabaseTestType . ObjectExist ,
146
146
DatabaseKind . PostgreSQL )
147
147
} . ToExpectedObject ( ) ;
@@ -167,12 +167,14 @@ public async Task PostgresqlRecordExistScriptTest_Success()
167
167
var generator = new PostgresqlTestGenerator ( options =>
168
168
{
169
169
options . AddDatabaseRecordExitsRule (
170
- new List < DatabaseRule > ( )
170
+ new List < DatabaseRecordExistRule > ( )
171
171
{
172
- new DatabaseRule ( )
172
+ new DatabaseRecordExistRule ( )
173
173
{
174
174
TableName = "mytable" ,
175
- PredicateValue = "name = 'myname'"
175
+ ColumnName = "name" ,
176
+ Operator = "=" ,
177
+ Value = "myname"
176
178
}
177
179
} ) ;
178
180
} ) ;
@@ -181,7 +183,7 @@ public async Task PostgresqlRecordExistScriptTest_Success()
181
183
{
182
184
new DatabaseScript (
183
185
"mytable" ,
184
- $@ "SELECT EXISTS (SELECT 1 FROM mytable WHERE name = 'myname');",
186
+ $@ "SELECT EXISTS(SELECT * FROM "" mytable"" WHERE "" name"" = 'myname');",
185
187
DatabaseTestType . RecordExist ,
186
188
DatabaseKind . PostgreSQL )
187
189
} . ToExpectedObject ( ) ;
@@ -196,12 +198,13 @@ public async Task PostgresqlRecordCountScriptTest_Success()
196
198
var generator = new PostgresqlTestGenerator ( options =>
197
199
{
198
200
options . AddDatabaseRecordsCountRule (
199
- new List < DatabaseRule > ( )
201
+ new List < DatabaseRecordCountRule > ( )
200
202
{
201
- new DatabaseRule ( )
203
+ new DatabaseRecordCountRule ( )
202
204
{
203
205
TableName = "mytable" ,
204
- PredicateValue = "=100"
206
+ Operator = "=" ,
207
+ Count = 100
205
208
}
206
209
} ) ;
207
210
} ) ;
@@ -210,7 +213,7 @@ public async Task PostgresqlRecordCountScriptTest_Success()
210
213
{
211
214
new DatabaseScript (
212
215
"mytable" ,
213
- $@ "SELECT EXISTS (SELECT 1 FROM mytable WHERE (SELECT count (*) FROM mytable)= 100);",
216
+ $@ "SELECT EXISTS (SELECT * FROM "" mytable"" WHERE (SELECT COUNT (*) AS ""count"" FROM "" mytable"") = 100);",
214
217
DatabaseTestType . RecordCount ,
215
218
DatabaseKind . PostgreSQL )
216
219
} . ToExpectedObject ( ) ;
0 commit comments