Skip to content

Commit

Permalink
Support SQL 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Hertleif committed Mar 25, 2024
1 parent d35f2ad commit 35c3697
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@ geozero = {version = "0.9", features = [
], optional = true}
serde = {version = "1.0.144", features = ["derive"], optional = true}
serde_json = {version = "1.0.85", optional = true}
sqlx = {version = "0.6", optional = true, features = ["runtime-tokio-rustls", "postgres"]}
sqlx = {version = "0.7.4", optional = true, features = ["runtime-tokio-rustls", "postgres"]}

[dev-dependencies]
tokio = {version = "1.21.1", features = ["full"]}

[dev-dependencies.sqlx]
features = ["runtime-tokio-rustls", "postgres"]
version = "0.6"
tokio = { version = "1.21.1", features = ["full"] }
sqlx = {version = "0.7.4", features = ["runtime-tokio-rustls", "postgres"]}

[features]
serde = [
Expand Down
6 changes: 3 additions & 3 deletions src/geometry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,18 @@ mod sqlx_tests {
sqlx::query(&format!(
"CREATE TABLE test ( id SERIAL PRIMARY KEY, geom GEOMETRY({type_name}, 26910) )"
))
.execute(&mut conn)
.execute(&mut *conn)
.await
.unwrap();

sqlx::query("INSERT INTO test (geom) VALUES ($1)")
.bind(data_to)
.execute(&mut conn)
.execute(&mut *conn)
.await
.unwrap();

let (data_from,): (Geometry,) = sqlx::query_as("SELECT geom FROM test")
.fetch_one(&mut conn)
.fetch_one(&mut *conn)
.await
.unwrap();

Expand Down
6 changes: 3 additions & 3 deletions src/point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,18 @@ mod sqlx_tests {
sqlx::query(&format!(
"CREATE TABLE test ( id SERIAL PRIMARY KEY, geom GEOMETRY({type_name}, 26910) )"
))
.execute(&mut conn)
.execute(&mut *conn)
.await
.unwrap();

sqlx::query("INSERT INTO test (geom) VALUES ($1)")
.bind(data_to)
.execute(&mut conn)
.execute(&mut *conn)
.await
.unwrap();

let (data_from,): (Point,) = sqlx::query_as("SELECT geom FROM test")
.fetch_one(&mut conn)
.fetch_one(&mut *conn)
.await
.unwrap();

Expand Down
6 changes: 3 additions & 3 deletions src/polygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,18 @@ mod sqlx_tests {
sqlx::query(&format!(
"CREATE TABLE test ( id SERIAL PRIMARY KEY, geom GEOMETRY({type_name}, 26910) )"
))
.execute(&mut conn)
.execute(&mut *conn)
.await
.unwrap();

sqlx::query("INSERT INTO test (geom) VALUES ($1)")
.bind(data_to)
.execute(&mut conn)
.execute(&mut *conn)
.await
.unwrap();

let (data_from,): (Polygon,) = sqlx::query_as("SELECT geom FROM test")
.fetch_one(&mut conn)
.fetch_one(&mut *conn)
.await
.unwrap();

Expand Down

0 comments on commit 35c3697

Please sign in to comment.