-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More precise typechecking using vendor types
The main motivation is to provide more precise typechecking information when dealing with date & time types, because each database driver report vastly different JDBC types. For example, in PostgreSQL the correct DB column type to store a java.time.Instant is TIMESTAMP WITH TIMEZONE (TIMESTAMPTZ). However, PostgreSQL JDBC driver reports the this column as JdbcType.Timestamp instead of JdbcType.TimestampWithTimezone. It also reports JdbcType.Timestamp for TIMESTAMP column type, which means we cannot meaningfully typecheck the query handling Instants with just JdbcType alone. The saving grace is JDBC's vendorTypeName, which Postgres correctly differentiates between TIMESTAMPTZ and TIMESTAMP. Main changes: - Add an optional vendorTypeNames to Put and Get. When non-empty, the JDBC reported column/parameter vendor types will be checked against this during typecheck tests.
- Loading branch information
Showing
27 changed files
with
447 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
version: '3.1' | ||
|
||
services: | ||
|
||
postgres: | ||
image: postgis/postgis:11-3.3 | ||
image: postgis/postgis:16-3.4 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: world | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- ./init/:/docker-entrypoint-initdb.d/ | ||
- ./init/postgres/:/docker-entrypoint-initdb.d/ | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 500M | ||
|
||
|
||
mysql: | ||
image: mysql:8.0-debian | ||
environment: | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: world | ||
ports: | ||
- 3306:3306 | ||
volumes: | ||
- ./init/mysql/:/docker-entrypoint-initdb.d/ | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 500M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
CREATE TABLE IF NOT EXISTS test ( | ||
c_integer INTEGER NOT NULL, | ||
c_varchar VARCHAR(1024) NOT NULL, | ||
c_date DATE NOT NULL, | ||
c_datetime DATETIME(6) NOT NULL, | ||
c_time TIME(6) NOT NULL, | ||
c_timestamp TIMESTAMP(6) NOT NULL | ||
); | ||
INSERT INTO test(c_integer, c_varchar, c_date, c_datetime, c_time, c_timestamp) | ||
VALUES (123, 'str', '2019-02-13', '2019-02-13 22:03:21.051', '22:03:21.051', '2019-02-13 22:03:21.051'); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.