Skip to content

Commit c51c142

Browse files
authored
test(go): fix metadata in validation cases (#87)
## What's Changed Fix various SQL type names.
1 parent 78f237b commit c51c142

28 files changed

+719
-45
lines changed

go/docs/bigquery.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Examples:
111111

112112
To see documentation for previous versions of this driver, see the following:
113113

114-
- [v0.1.1](./v0.1.1.md)
114+
- [v1.10.0](./v1.10.0.md)
115+
- [v1.0.0](./v1.0.0.md)
115116

116117
{{ footnotes|safe }}
117118

go/pixi.lock

Lines changed: 37 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) 2025 ADBC Drivers Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// part: metadata
16+
17+
[tags]
18+
sql-type-name = "BYTES"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) 2025 ADBC Drivers Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// part: metadata
16+
17+
[tags]
18+
sql-type-name = "BYTES"
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) 2025 ADBC Drivers Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// part: metadata
16+
17+
[tags]
18+
sql-type-name = "STRING"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) 2025 ADBC Drivers Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// part: metadata
16+
17+
[tags]
18+
sql-type-name = "TIME"
19+
20+
// part: expected_schema
21+
22+
{
23+
"format": "+s",
24+
"children": [
25+
{
26+
"name": "idx",
27+
"format": "l",
28+
"flags": ["nullable"]
29+
},
30+
{
31+
"name": "value",
32+
"format": "ttu",
33+
"flags": ["nullable"]
34+
}
35+
]
36+
}
37+
38+
// part: expected
39+
40+
{"idx": 0, "value": 0}
41+
{"idx": 1, "value": 3661000000}
42+
{"idx": 2, "value": 43200000000}
43+
{"idx": 3, "value": 49531123000}
44+
{"idx": 4, "value": 86399999000}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2025 ADBC Drivers Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// TODO: truncate the data on the driver side
16+
// part: metadata
17+
18+
[tags]
19+
broken-vendor = "This is broken on Google's side; it appears BigQuery treats time64[ns] as int64, and throws a type error"
20+
sql-type-name = "TIME"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright (c) 2025 ADBC Drivers Contributors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// part: metadata
16+
17+
[tags]
18+
sql-type-name = "TIME"
19+
20+
// part: expected_schema
21+
22+
{
23+
"format": "+s",
24+
"children": [
25+
{
26+
"name": "idx",
27+
"format": "l",
28+
"flags": ["nullable"]
29+
},
30+
{
31+
"name": "value",
32+
"format": "ttu",
33+
"flags": ["nullable"]
34+
}
35+
]
36+
}
37+
38+
// part: expected
39+
40+
{"idx": 0, "value": 0}
41+
{"idx": 1, "value": 3661000000}
42+
{"idx": 2, "value": 43200000000}
43+
{"idx": 3, "value": 49531000000}
44+
{"idx": 4, "value": 86399000000}

0 commit comments

Comments
 (0)