TestSessionTransactionModes tests transaction mode commands
(t *testing.T)
| 245 | |
| 246 | // TestSessionTransactionModes tests transaction mode commands |
| 247 | func TestSessionTransactionModes(t *testing.T) { |
| 248 | // These should not error, but may be effectively no-ops |
| 249 | tests := []QueryTest{ |
| 250 | { |
| 251 | Name: "begin_read_committed", |
| 252 | Query: "BEGIN ISOLATION LEVEL READ COMMITTED", |
| 253 | DuckgresOnly: true, |
| 254 | }, |
| 255 | { |
| 256 | Name: "begin_repeatable_read", |
| 257 | Query: "BEGIN ISOLATION LEVEL REPEATABLE READ", |
| 258 | DuckgresOnly: true, |
| 259 | }, |
| 260 | { |
| 261 | Name: "begin_serializable", |
| 262 | Query: "BEGIN ISOLATION LEVEL SERIALIZABLE", |
| 263 | DuckgresOnly: true, |
| 264 | }, |
| 265 | { |
| 266 | Name: "begin_read_only", |
| 267 | Query: "BEGIN READ ONLY", |
| 268 | DuckgresOnly: true, |
| 269 | }, |
| 270 | { |
| 271 | Name: "begin_read_write", |
| 272 | Query: "BEGIN READ WRITE", |
| 273 | DuckgresOnly: true, |
| 274 | }, |
| 275 | } |
| 276 | |
| 277 | for _, test := range tests { |
| 278 | t.Run(test.Name, func(t *testing.T) { |
| 279 | _, err := testHarness.DuckgresDB.Exec(test.Query) |
| 280 | if err != nil { |
| 281 | t.Errorf("Query failed: %v", err) |
| 282 | } |
| 283 | // Always rollback to clean up |
| 284 | _, _ = testHarness.DuckgresDB.Exec("ROLLBACK") |
| 285 | }) |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | // TestSessionReset tests RESET command |
| 290 | func TestSessionReset(t *testing.T) { |