Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration: geometry #4507

Closed
wants to merge 31 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f3784ac
feat: geospatial types support
Oreilles Nov 23, 2023
e605279
chore: add postgis database to query engine test matrix
Oreilles Sep 8, 2023
0a750da
fix: mysql geometries should be serialized to wkb by quaint
Oreilles Sep 8, 2023
9844033
fix: failing inequality operator with PostGIS
Oreilles Sep 8, 2023
b267f61
fix: PostGIS tests need to happen with the public schema exposed
Oreilles Sep 8, 2023
2aaf40b
fix: add missing GeometryFiltering capability constraint to geometric…
Oreilles Sep 8, 2023
b9f411f
fix: srid introspection in postgres dialect
Oreilles Sep 9, 2023
f42f3ba
fix: handle geography default srid value inconsistency in tests
Oreilles Sep 9, 2023
c44ee7a
fix: remove unused variable
Oreilles Sep 9, 2023
c16fcd7
fix: geography srid introspection test in postgres dialect
Oreilles Sep 9, 2023
6f2db0f
fix: actually fix geography srid introspection test in postgres dialect
Oreilles Sep 9, 2023
a5097de
fix: simplify mysql srid introspection on mysql and fixes vitess tests
Oreilles Sep 9, 2023
98c913f
fix: add missing MySQL version constraint for test requiring support …
Oreilles Nov 12, 2023
e287c38
fix: ignore unsuccessful initialization of SpatiaLite in SQLite query…
Oreilles Nov 12, 2023
4e4308c
fix: replace intersection test due to MySQL 5.6 quirk
Oreilles Nov 13, 2023
16f004c
fix: formatting
Oreilles Nov 19, 2023
71dae2e
fix: make Spatialite geometry filters stricter and tighten geometry f…
Oreilles Nov 19, 2023
93f582c
fix: add SQLite test versions 3 and 3-spatialite, only run query engi…
Oreilles Nov 25, 2023
6cd70be
chore: add Spatialite tests to CI
Oreilles Nov 24, 2023
e6185be
fix: incorrect dependency order
Oreilles Nov 26, 2023
42e5914
fix: add missing Spatialite system table to the list
Oreilles Nov 26, 2023
e1da2f7
fix: null_geometry return value
Oreilles Nov 26, 2023
5a255ac
refactor: share SQLITE_SYSTEM_TABLES with sql-schema-connector
Oreilles Nov 28, 2023
1290ef7
refactor: execute InitSpatialMetaData in quaint
Oreilles Nov 28, 2023
bb7e33c
fix: Spatialite diff migration tests
Oreilles Nov 28, 2023
455b274
fix: formatting
Oreilles Nov 28, 2023
35a9f15
fix: revert Sqlite total queries to 9
Oreilles Nov 28, 2023
7b8348c
fix: install Spatialite with sudo
Oreilles Nov 28, 2023
31228b5
fix: add WGS84_ONLY option to `InitSpatialMetadata` and only call the…
Oreilles Nov 29, 2023
8a5288b
fix: formatting
Oreilles Nov 29, 2023
e0f834d
fix: skip geometric_comparison_filters test for MariaDB while we figu…
Oreilles Nov 30, 2023
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
30 changes: 30 additions & 0 deletions .github/workflows/test-query-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
single_threaded: true
connector: 'postgres'
version: '15'
- name: 'postgis15'
single_threaded: true
connector: 'postgres'
version: '15-postgis'
- name: 'mssql_2022'
single_threaded: false
connector: 'sqlserver'
Expand All @@ -41,6 +45,10 @@ jobs:
single_threaded: false
connector: 'sqlite'
version: '3'
- name: 'spatialite'
single_threaded: false
connector: 'sqlite'
version: '3-spatialite'
- name: 'mongodb_4_2'
single_threaded: true
connector: 'mongodb'
Expand All @@ -57,6 +65,22 @@ jobs:
single_threaded: false
connector: 'cockroachdb'
version: '22.1'
- name: 'mysql_5_6'
single_threaded: true
connector: 'mysql'
version: '5.6'
- name: 'mysql_5_7'
single_threaded: true
connector: 'mysql'
version: '5.7'
- name: 'mysql_8'
single_threaded: true
connector: 'mysql'
version: '8'
- name: 'mysql_mariadb'
single_threaded: true
connector: 'mysql'
version: 'mariadb'
engine_protocol: [graphql, json]

env:
Expand Down Expand Up @@ -93,12 +117,18 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- name: Install Spatialite
if: ${{ matrix.database.name == 'spatialite' }}
run: sudo apt install -y libsqlite3-mod-spatialite

- run: export WORKSPACE_ROOT=$(pwd) && cargo test --package query-engine-tests -- --test-threads=1
if: ${{ matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
SPATIALITE_PATH: ${{ matrix.database.name == 'spatialite' && 'mod_spatialite' || null }}

- run: export WORKSPACE_ROOT=$(pwd) && cargo test --package query-engine-tests -- --test-threads=8
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
SPATIALITE_PATH: ${{ matrix.database.name == 'spatialite' && 'mod_spatialite' || null }}
12 changes: 12 additions & 0 deletions .github/workflows/test-schema-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ jobs:
url: 'postgresql://postgres:prisma@localhost:5437'
- name: postgres15
url: 'postgresql://postgres:prisma@localhost:5438'
- name: postgis15
url: 'postgresql://postgres:prisma@localhost:5439'
- name: cockroach_23_1
url: 'postgresql://prisma@localhost:26260'
- name: cockroach_22_2
Expand All @@ -94,6 +96,8 @@ jobs:
url: 'postgresql://prisma@localhost:26257'
- name: sqlite
url: sqlite
- name: spatialite
url: sqlite
- name: vitess_8_0
url: 'mysql://root:prisma@localhost:33807/test'
shadow_database_url: 'mysql://root:prisma@localhost:33808/shadow'
Expand All @@ -116,6 +120,10 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Install Spatialite
if: ${{ matrix.database.name == 'spatialite' }}
run: sudo apt install -y libsqlite3-mod-spatialite

- name: 'Start ${{ matrix.database.name }}'
run: make start-${{ matrix.database.name }}

Expand All @@ -124,25 +132,29 @@ jobs:
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
SPATIALITE_PATH: ${{ matrix.database.name == 'spatialite' && 'mod_spatialite' || null }}

- run: cargo test -p sql-schema-describer
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
SPATIALITE_PATH: ${{ matrix.database.name == 'spatialite' && 'mod_spatialite' || null }}

- run: cargo test -p sql-migration-tests
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
SPATIALITE_PATH: ${{ matrix.database.name == 'spatialite' && 'mod_spatialite' || null }}
RUST_LOG: debug

- run: cargo test -p schema-engine-cli
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
SPATIALITE_PATH: ${{ matrix.database.name == 'spatialite' && 'mod_spatialite' || null }}

- run: cargo test -p sql-introspection-tests -- --test-threads=1
if: ${{ matrix.database.is_vitess }}
Expand Down
1 change: 1 addition & 0 deletions .test_database_urls/postgis_15
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export TEST_DATABASE_URL="postgresql://postgres:prisma@localhost:5439"
112 changes: 101 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ start-sqlite:
dev-sqlite:
cp $(CONFIG_PATH)/sqlite $(CONFIG_FILE)

start-spatialite:

dev-spatialite:
cp $(CONFIG_PATH)/spatialite $(CONFIG_FILE)

dev-libsql-js: build-qe-napi build-connector-kit-js
cp $(CONFIG_PATH)/libsql-js $(CONFIG_FILE)

Expand Down Expand Up @@ -173,6 +178,12 @@ start-postgres15:
dev-postgres15: start-postgres15
cp $(CONFIG_PATH)/postgres15 $(CONFIG_FILE)

start-postgis15:
docker compose -f docker-compose.yml up -d --remove-orphans postgis15

dev-postgis15: start-postgis15
cp $(CONFIG_PATH)/postgis15 $(CONFIG_FILE)

start-cockroach_23_1:
docker compose -f docker-compose.yml up --wait -d --remove-orphans cockroach_23_1

Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,19 @@ services:
networks:
- databases

postgis15:
image: postgis/postgis:15-3.3
restart: always
command: postgres -c 'max_connections=1000'
environment:
POSTGRES_PASSWORD: "prisma"
POSTGRES_HOST_AUTH_METHOD: "md5"
POSTGRES_INITDB_ARGS: "--auth-host=md5"
ports:
- "5439:5432"
networks:
- databases

mysql-5-6:
image: mysql:5.6.50
command: mysqld
Expand Down
Loading
Loading