mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 13:20:59 +00:00
* fix(postgres): sqlx prepare fails if shared_preload_libraries=pg_stat_statements closes #2622 refs: * https://serde.rs/enum-representations.html#untagged * https://serde.rs/field-attrs.html#skip * https://www.postgresql.org/docs/current/pgstatstatements.html * https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-COMPUTE-QUERY-ID * fix(postgres): regression of #1449 ``` error: error occurred while decoding column 0: data did not match any variant of untagged enum Explain at line 3 column 1 Error: --> tests/postgres/macros.rs:103:15 | 103 | let row = sqlx::query!(r#"CALL forty_two(null)"#) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `$crate::sqlx_macros::expand_query` which comes from the expansion of the macro `sqlx::query` (in Nightly builds, run with -Z macro-backtrace for more info) error: could not compile `sqlx` (test "postgres-macros") due to previous error ``` * refactor(postgres): don't define unused fields in QueryPlan * refactor(postgres): simplify query plan handling, add unit test * chore: document why we load `pg_stat_statements` in tests --------- Co-authored-by: mrl5 <31549762+mrl5@users.noreply.github.com>
350 lines
11 KiB
YAML
350 lines
11 KiB
YAML
version: "3"
|
|
|
|
services:
|
|
#
|
|
# MySQL 8.x, 5.7.x
|
|
# https://www.mysql.com/support/supportedplatforms/database.html
|
|
#
|
|
|
|
mysql_8:
|
|
# FIXME: 8.0.28 introduced a regression in our type tests: https://github.com/launchbadge/sqlx/issues/1664
|
|
# The MySQL devs agreed that it was a regression and that it will be fixed in 8.0.29
|
|
image: mysql:8.0.27
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_HOST: '%'
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: sqlx
|
|
|
|
mysql_8_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: mysql/Dockerfile
|
|
args:
|
|
IMAGE: mysql:8.0.27
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_HOST: '%'
|
|
MYSQL_DATABASE: sqlx
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: 1
|
|
|
|
mysql_5_7:
|
|
image: mysql:5.7
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_HOST: '%'
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: sqlx
|
|
|
|
mysql_5_7_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: mysql/Dockerfile
|
|
args:
|
|
IMAGE: mysql:5.7
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_HOST: '%'
|
|
MYSQL_DATABASE: sqlx
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: 1
|
|
|
|
#
|
|
# MariaDB 10.6, 10.5, 10.4, 10.3
|
|
# https://mariadb.org/about/#maintenance-policy
|
|
#
|
|
|
|
mariadb_10_6:
|
|
image: mariadb:10.6
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: sqlx
|
|
|
|
mariadb_10_6_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: mysql/Dockerfile
|
|
args:
|
|
IMAGE: mariadb:10.6
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MARIADB_DATABASE: sqlx
|
|
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
|
|
|
|
mariadb_10_5:
|
|
image: mariadb:10.5
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: sqlx
|
|
|
|
mariadb_10_5_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: mysql/Dockerfile
|
|
args:
|
|
IMAGE: mariadb:10.5
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MARIADB_DATABASE: sqlx
|
|
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
|
|
|
|
mariadb_10_4:
|
|
image: mariadb:10.4
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: sqlx
|
|
|
|
mariadb_10_4_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: mysql/Dockerfile
|
|
args:
|
|
IMAGE: mariadb:10.4
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MARIADB_DATABASE: sqlx
|
|
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
|
|
|
|
mariadb_10_3:
|
|
image: mariadb:10.3
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: sqlx
|
|
|
|
mariadb_10_3_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: mysql/Dockerfile
|
|
args:
|
|
IMAGE: mariadb:10.3
|
|
volumes:
|
|
- "./mysql/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
ports:
|
|
- 3306
|
|
environment:
|
|
MARIADB_DATABASE: sqlx
|
|
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 1
|
|
|
|
#
|
|
# PostgreSQL 15.x, 14.x, 13.x, 12.x, 11.x
|
|
# https://www.postgresql.org/support/versioning/
|
|
#
|
|
|
|
postgres_15:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 15
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
|
|
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
# Loading `pg_stat_statements` should serve as a regression test for:
|
|
# https://github.com/launchbadge/sqlx/issues/2622
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c shared_preload_libraries=pg_stat_statements
|
|
|
|
postgres_15_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 15
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
POSTGRES_INITDB_ARGS: --auth-host=trust
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c ssl_ca_file=/var/lib/postgresql/ca.crt -c hba_file=/var/lib/postgresql/pg_hba.conf
|
|
|
|
postgres_14:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 14
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
|
|
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
|
|
|
|
postgres_14_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 14
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
POSTGRES_INITDB_ARGS: --auth-host=trust
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c ssl_ca_file=/var/lib/postgresql/ca.crt -c hba_file=/var/lib/postgresql/pg_hba.conf
|
|
|
|
postgres_13:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 13
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
|
|
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
|
|
|
|
postgres_13_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 13
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
POSTGRES_INITDB_ARGS: --auth-host=trust
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c ssl_ca_file=/var/lib/postgresql/ca.crt -c hba_file=/var/lib/postgresql/pg_hba.conf
|
|
|
|
postgres_12:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 12
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
|
|
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
|
|
|
|
postgres_12_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 12.3
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
POSTGRES_INITDB_ARGS: --auth-host=trust
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c ssl_ca_file=/var/lib/postgresql/ca.crt -c hba_file=/var/lib/postgresql/pg_hba.conf
|
|
|
|
postgres_11:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 11
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_HOST_AUTH_METHOD: scram-sha-256
|
|
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
|
|
|
|
postgres_11_client_ssl:
|
|
build:
|
|
context: .
|
|
dockerfile: postgres/Dockerfile
|
|
args:
|
|
VERSION: 11
|
|
ports:
|
|
- 5432
|
|
environment:
|
|
POSTGRES_DB: sqlx
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
POSTGRES_INITDB_ARGS: --auth-host=trust
|
|
volumes:
|
|
- "./postgres/setup.sql:/docker-entrypoint-initdb.d/setup.sql"
|
|
command: >
|
|
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c ssl_ca_file=/var/lib/postgresql/ca.crt -c hba_file=/var/lib/postgresql/pg_hba.conf
|