| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4da06a6 commit ea5efe4
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,7 @@ | |||
| 33 | 33 | JSON = Type(code=TypeCode.JSON) | |
| 34 | 34 | PG_NUMERIC = Type(code=TypeCode.NUMERIC, type_annotation=TypeAnnotationCode.PG_NUMERIC) | |
| 35 | 35 | PG_JSONB = Type(code=TypeCode.JSON, type_annotation=TypeAnnotationCode.PG_JSONB) | |
| 36 | + PG_OID = Type(code=TypeCode.INT64, type_annotation=TypeAnnotationCode.PG_OID) | ||
| 36 | 37 | ||
| 37 | 38 | ||
| 38 | 39 | def Array(element_type): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2348,6 +2348,18 @@ def test_execute_sql_w_jsonb_bindings( | |||
| 2348 | 2348 | ) | |
| 2349 | 2349 | ||
| 2350 | 2350 | ||
| 2351 | + def test_execute_sql_w_oid_bindings( | ||
| 2352 | + not_emulator, not_google_standard_sql, sessions_database, database_dialect | ||
| 2353 | + ): | ||
| 2354 | + _bind_test_helper( | ||
| 2355 | + sessions_database, | ||
| 2356 | + database_dialect, | ||
| 2357 | + spanner_v1.param_types.PG_OID, | ||
| 2358 | + 123, | ||
| 2359 | + [123, 456], | ||
| 2360 | + ) | ||
| 2361 | + | ||
| 2362 | + | ||
| 2351 | 2363 | def test_execute_sql_w_query_param_struct(sessions_database, not_postgres): | |
| 2352 | 2364 | name = "Phred" | |
| 2353 | 2365 | count = 123 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,3 +70,20 @@ def test_it(self): | |||
| 70 | 70 | found = param_types.PG_JSONB | |
| 71 | 71 | ||
| 72 | 72 | self.assertEqual(found, expected) | |
| 73 | + | ||
| 74 | + | ||
| 75 | + class Test_OidParamType(unittest.TestCase): | ||
| 76 | + def test_it(self): | ||
| 77 | + from google.cloud.spanner_v1 import Type | ||
| 78 | + from google.cloud.spanner_v1 import TypeCode | ||
| 79 | + from google.cloud.spanner_v1 import TypeAnnotationCode | ||
| 80 | + from google.cloud.spanner_v1 import param_types | ||
| 81 | + | ||
| 82 | + expected = Type( | ||
| 83 | + code=TypeCode.INT64, | ||
| 84 | + type_annotation=TypeAnnotationCode.PG_OID, | ||
| 85 | + ) | ||
| 86 | + | ||
| 87 | + found = param_types.PG_OID | ||
| 88 | + | ||
| 89 | + self.assertEqual(found, expected) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments