Skip to content

Commit

Permalink
Start testing on Postgres 15 and drop Postgres 10 (#2193)
Browse files Browse the repository at this point in the history
* CHANGELOG: mention that users should upgrade CLI

* Drop postgres 10 start testing postgres 15

---------

Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
  • Loading branch information
paolobarbolini and abonander committed Feb 18, 2023
1 parent 9e55c9b commit b2d1068
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sqlx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
postgres: [14, 10]
postgres: [15, 11]
runtime: [async-std, tokio]
tls: [native-tls, rustls, none]
needs: check
Expand Down
6 changes: 3 additions & 3 deletions sqlx-core/src/acquire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::ops::{Deref, DerefMut};
///
/// ```rust
/// # use sqlx::{Acquire, postgres::Postgres, error::BoxDynError};
/// # #[cfg(any(postgres_9_6, postgres_14))]
/// # #[cfg(any(postgres_9_6, postgres_15))]
/// async fn run_query<'a, A>(conn: A) -> Result<(), BoxDynError>
/// where
/// A: Acquire<'a, Database = Postgres>,
Expand All @@ -35,7 +35,7 @@ use std::ops::{Deref, DerefMut};
/// ```rust
/// # use std::future::Future;
/// # use sqlx::{Acquire, postgres::Postgres, error::BoxDynError};
/// # #[cfg(any(postgres_9_6, postgres_14))]
/// # #[cfg(any(postgres_9_6, postgres_15))]
/// fn run_query<'a, 'c, A>(conn: A) -> impl Future<Output = Result<(), BoxDynError>> + Send + 'a
/// where
/// A: Acquire<'c, Database = Postgres> + Send + 'a,
Expand All @@ -57,7 +57,7 @@ use std::ops::{Deref, DerefMut};
///
/// ```rust
/// # use sqlx::{postgres::PgConnection, error::BoxDynError};
/// # #[cfg(any(postgres_9_6, postgres_14))]
/// # #[cfg(any(postgres_9_6, postgres_15))]
/// async fn run_query(conn: &mut PgConnection) -> Result<(), BoxDynError> {
/// sqlx::query!("SELECT 1 as v").fetch_one(&mut *conn).await?;
/// sqlx::query!("SELECT 2 as v").fetch_one(&mut *conn).await?;
Expand Down
24 changes: 12 additions & 12 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ services:
MYSQL_DATABASE: sqlx

#
# PostgreSQL 14.x, 13.x, 12.x, 11.x 10.x
# PostgreSQL 15.x, 14.x, 13.x, 12.x, 11.x
# https://www.postgresql.org/support/versioning/
#

postgres_14:
postgres_15:
build:
context: .
dockerfile: postgres/Dockerfile
args:
VERSION: 14
VERSION: 15
ports:
- 5432
environment:
Expand All @@ -98,12 +98,12 @@ services:
command: >
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
postgres_13:
postgres_14:
build:
context: .
dockerfile: postgres/Dockerfile
args:
VERSION: 13
VERSION: 14
ports:
- 5432
environment:
Expand All @@ -117,12 +117,12 @@ services:
command: >
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
postgres_12:
postgres_13:
build:
context: .
dockerfile: postgres/Dockerfile
args:
VERSION: 12
VERSION: 13
ports:
- 5432
environment:
Expand All @@ -136,14 +136,14 @@ services:
command: >
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
postgres_11:
postgres_12:
build:
context: .
dockerfile: postgres/Dockerfile
args:
VERSION: 11
VERSION: 12
ports:
- 5432
- 5432
environment:
POSTGRES_DB: sqlx
POSTGRES_USER: postgres
Expand All @@ -155,12 +155,12 @@ services:
command: >
-c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
postgres_10:
postgres_11:
build:
context: .
dockerfile: postgres/Dockerfile
args:
VERSION: 10
VERSION: 11
ports:
- 5432
environment:
Expand Down
4 changes: 2 additions & 2 deletions tests/postgres/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,15 @@ test_prepared_type!(money_vec<Vec<PgMoney>>(Postgres,

// FIXME: needed to disable `ltree` tests in version that don't have a binary format for it
// but `PgLTree` should just fall back to text format
#[cfg(postgres_14)]
#[cfg(any(postgres_14, postgres_15))]
test_type!(ltree<sqlx::postgres::types::PgLTree>(Postgres,
"'Foo.Bar.Baz.Quux'::ltree" == sqlx::postgres::types::PgLTree::from_str("Foo.Bar.Baz.Quux").unwrap(),
"'Alpha.Beta.Delta.Gamma'::ltree" == sqlx::postgres::types::PgLTree::from_iter(["Alpha", "Beta", "Delta", "Gamma"]).unwrap(),
));

// FIXME: needed to disable `ltree` tests in version that don't have a binary format for it
// but `PgLTree` should just fall back to text format
#[cfg(postgres_14)]
#[cfg(any(postgres_14, postgres_15))]
test_type!(ltree_vec<Vec<sqlx::postgres::types::PgLTree>>(Postgres,
"array['Foo.Bar.Baz.Quux', 'Alpha.Beta.Delta.Gamma']::ltree[]" ==
vec![
Expand Down
4 changes: 2 additions & 2 deletions tests/x.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data
# postgres
#

for version in ["14", "13", "12", "11", "10"]:
for version in ["15", "14", "13", "12", "11"]:
run(
f"cargo test --no-default-features --features macros,any,unstable-all-types,postgres,runtime-{runtime},tls-{tls}",
comment=f"test postgres {version}",
Expand All @@ -178,7 +178,7 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data
)

## +ssl
for version in ["14", "13", "12", "11", "10"]:
for version in ["15", "14", "13", "12", "11"]:
run(
f"cargo test --no-default-features --features macros,any,_unstable-all-types,postgres,runtime-{runtime},tls-{tls}",
comment=f"test postgres {version} ssl",
Expand Down

0 comments on commit b2d1068

Please sign in to comment.