Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions adbc_drivers_validation/queries/type/select/timestamp0.txtcase
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2026 ADBC Drivers Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// part: metadata

[setup]
drop = "test_timestamp"

[tags]
sql-type-name = "TIMESTAMP(0)"
field-type-name = "TIMESTAMP(0)"

// part: setup_query

CREATE TABLE test_timestamp (
idx INTEGER,
res TIMESTAMP(0)
);

INSERT INTO test_timestamp (idx, res) VALUES (1, TIMESTAMP '2023-05-15 13:45:30');
INSERT INTO test_timestamp (idx, res) VALUES (2, TIMESTAMP '2000-01-01 00:00:00');
INSERT INTO test_timestamp (idx, res) VALUES (3, TIMESTAMP '1969-07-20 20:17:40');
INSERT INTO test_timestamp (idx, res) VALUES (4, TIMESTAMP '0001-01-01 00:00:00');
INSERT INTO test_timestamp (idx, res) VALUES (5, TIMESTAMP '9999-12-31 23:59:59');
INSERT INTO test_timestamp (idx, res) VALUES (6, NULL);

// part: query

SELECT res FROM test_timestamp ORDER BY idx

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "tss:",
"flags": ["nullable"]
}
]
}

// part: expected

{"res": 1684158330}
{"res": 946684800}
{"res": -14182940}
{"res": -62135596800}
{"res": 253402300799}
{"res": null}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2026 ADBC Drivers Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// part: metadata

[setup]
drop = "test_timestamptz"

[tags]
sql-type-name = "TIMESTAMP(0) WITH TIME ZONE"
field-type-name = "TIMESTAMP(0) WITH TIME ZONE"

// part: setup_query

CREATE TABLE test_timestamptz (
idx INTEGER,
res TIMESTAMP(0) WITH TIME ZONE
);

INSERT INTO test_timestamptz (idx, res) VALUES (1, TIMESTAMP WITH TIME ZONE '2023-05-15 13:45:30+00');
INSERT INTO test_timestamptz (idx, res) VALUES (2, TIMESTAMP WITH TIME ZONE '2000-01-01 00:00:00+00');
INSERT INTO test_timestamptz (idx, res) VALUES (3, TIMESTAMP WITH TIME ZONE '1969-07-20 20:17:40+00');
INSERT INTO test_timestamptz (idx, res) VALUES (4, TIMESTAMP WITH TIME ZONE '0001-01-01 00:00:00+00');
INSERT INTO test_timestamptz (idx, res) VALUES (5, TIMESTAMP WITH TIME ZONE '9999-12-31 23:59:59+00');
INSERT INTO test_timestamptz (idx, res) VALUES (6, NULL);

// part: query

SELECT res FROM test_timestamptz ORDER BY idx

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "tss:UTC",
"flags": ["nullable"]
}
]
}

// part: expected

{"res": 1684158330}
{"res": 946684800}
{"res": -14182940}
{"res": -62135596800}
{"res": 253402300799}
{"res": null}
62 changes: 62 additions & 0 deletions adbc_drivers_validation/queries/type/select/timestamp1.txtcase
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2026 ADBC Drivers Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// part: metadata

[setup]
drop = "test_timestamp"

[tags]
sql-type-name = "TIMESTAMP(p) (1 <= p <= 3)"
field-type-name = "TIMESTAMP(1)"

// part: setup_query

CREATE TABLE test_timestamp (
idx INTEGER,
res TIMESTAMP(1)
);

INSERT INTO test_timestamp (idx, res) VALUES (1, TIMESTAMP '2023-05-15 13:45:30.1');
INSERT INTO test_timestamp (idx, res) VALUES (2, TIMESTAMP '2000-01-01 00:00:00.2');
INSERT INTO test_timestamp (idx, res) VALUES (3, TIMESTAMP '1969-07-20 20:17:40.3');
INSERT INTO test_timestamp (idx, res) VALUES (4, TIMESTAMP '0001-01-01 00:00:00.0');
INSERT INTO test_timestamp (idx, res) VALUES (5, TIMESTAMP '9999-12-31 23:59:59.9');
INSERT INTO test_timestamp (idx, res) VALUES (6, NULL);

// part: query

SELECT res FROM test_timestamp ORDER BY idx

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "tsm:",
"flags": ["nullable"]
}
]
}

// part: expected

{"res": 1684158330100}
{"res": 946684800200}
{"res": -14182939700}
{"res": -62135596800000}
{"res": 253402300799900}
{"res": null}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2026 ADBC Drivers Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// part: metadata

[setup]
drop = "test_timestamptz"

[tags]
sql-type-name = "TIMESTAMP(p) (1 <= p <= 3) WITH TIME ZONE"
field-type-name = "TIMESTAMP(1) WITH TIME ZONE"

// part: setup_query

CREATE TABLE test_timestamptz (
idx INTEGER,
res TIMESTAMP(1) WITH TIME ZONE
);

INSERT INTO test_timestamptz (idx, res) VALUES (1, TIMESTAMP WITH TIME ZONE '2023-05-15 13:45:30.1+00');
INSERT INTO test_timestamptz (idx, res) VALUES (2, TIMESTAMP WITH TIME ZONE '2000-01-01 00:00:00.2+00');
INSERT INTO test_timestamptz (idx, res) VALUES (3, TIMESTAMP WITH TIME ZONE '1969-07-20 20:17:40.3+00');
INSERT INTO test_timestamptz (idx, res) VALUES (4, TIMESTAMP WITH TIME ZONE '0001-01-01 00:00:00.0+00');
INSERT INTO test_timestamptz (idx, res) VALUES (5, TIMESTAMP WITH TIME ZONE '9999-12-31 23:59:59.9+00');
INSERT INTO test_timestamptz (idx, res) VALUES (6, NULL);

// part: query

SELECT res FROM test_timestamptz ORDER BY idx

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "tsm:UTC",
"flags": ["nullable"]
}
]
}

// part: expected

{"res": 1684158330100}
{"res": 946684800200}
{"res": -14182939700}
{"res": -62135596800000}
{"res": 253402300799900}
{"res": null}
62 changes: 62 additions & 0 deletions adbc_drivers_validation/queries/type/select/timestamp2.txtcase
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2026 ADBC Drivers Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// part: metadata

[setup]
drop = "test_timestamp"

[tags]
sql-type-name = "TIMESTAMP(p) (1 <= p <= 3)"
field-type-name = "TIMESTAMP(2)"

// part: setup_query

CREATE TABLE test_timestamp (
idx INTEGER,
res TIMESTAMP(2)
);

INSERT INTO test_timestamp (idx, res) VALUES (1, TIMESTAMP '2023-05-15 13:45:30.12');
INSERT INTO test_timestamp (idx, res) VALUES (2, TIMESTAMP '2000-01-01 00:00:00.23');
INSERT INTO test_timestamp (idx, res) VALUES (3, TIMESTAMP '1969-07-20 20:17:40.34');
INSERT INTO test_timestamp (idx, res) VALUES (4, TIMESTAMP '0001-01-01 00:00:00.00');
INSERT INTO test_timestamp (idx, res) VALUES (5, TIMESTAMP '9999-12-31 23:59:59.99');
INSERT INTO test_timestamp (idx, res) VALUES (6, NULL);

// part: query

SELECT res FROM test_timestamp ORDER BY idx

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "tsm:",
"flags": ["nullable"]
}
]
}

// part: expected

{"res": 1684158330120}
{"res": 946684800230}
{"res": -14182939660}
{"res": -62135596800000}
{"res": 253402300799990}
{"res": null}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright (c) 2026 ADBC Drivers Contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// part: metadata

[setup]
drop = "test_timestamptz"

[tags]
sql-type-name = "TIMESTAMP(p) (1 <= p <= 3) WITH TIME ZONE"
field-type-name = "TIMESTAMP(2) WITH TIME ZONE"

// part: setup_query

CREATE TABLE test_timestamptz (
idx INTEGER,
res TIMESTAMP(2) WITH TIME ZONE
);

INSERT INTO test_timestamptz (idx, res) VALUES (1, TIMESTAMP WITH TIME ZONE '2023-05-15 13:45:30.12+00');
INSERT INTO test_timestamptz (idx, res) VALUES (2, TIMESTAMP WITH TIME ZONE '2000-01-01 00:00:00.23+00');
INSERT INTO test_timestamptz (idx, res) VALUES (3, TIMESTAMP WITH TIME ZONE '1969-07-20 20:17:40.34+00');
INSERT INTO test_timestamptz (idx, res) VALUES (4, TIMESTAMP WITH TIME ZONE '0001-01-01 00:00:00.00+00');
INSERT INTO test_timestamptz (idx, res) VALUES (5, TIMESTAMP WITH TIME ZONE '9999-12-31 23:59:59.99+00');
INSERT INTO test_timestamptz (idx, res) VALUES (6, NULL);

// part: query

SELECT res FROM test_timestamptz ORDER BY idx

// part: expected_schema

{
"format": "+s",
"children": [
{
"name": "res",
"format": "tsm:UTC",
"flags": ["nullable"]
}
]
}

// part: expected

{"res": 1684158330120}
{"res": 946684800230}
{"res": -14182939660}
{"res": -62135596800000}
{"res": 253402300799990}
{"res": null}
Loading