Skip to content

Commit 4566df7

Browse files
authored
sqlx-postgres(tests): cleanup 2 unit tests. (#4002)
* sqlx-postgres(tests): fix positive_int domain type * sqlx-postgres(tests): Update no pg array test * sqlx-core: Remove conflicting Type impl for Box<JsonRawValue>
1 parent 648250d commit 4566df7

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

sqlx-core/src/types/json.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,6 @@ where
196196
}
197197
}
198198

199-
impl<DB> Type<DB> for Box<JsonRawValue>
200-
where
201-
for<'a> Json<&'a Self>: Type<DB>,
202-
DB: Database,
203-
{
204-
fn type_info() -> DB::TypeInfo {
205-
<Json<&Self> as Type<DB>>::type_info()
206-
}
207-
208-
fn compatible(ty: &DB::TypeInfo) -> bool {
209-
<Json<&Self> as Type<DB>>::compatible(ty)
210-
}
211-
}
212-
213199
impl<'q, DB> Encode<'q, DB> for JsonRawValue
214200
where
215201
for<'a> Json<&'a Self>: Encode<'q, DB>,

tests/postgres/derives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ async fn test_custom_pg_array() -> anyhow::Result<()> {
818818

819819
impl PgHasArrayType for User {
820820
fn array_type_info() -> sqlx::postgres::PgTypeInfo {
821-
sqlx::postgres::PgTypeInfo::array_of("Gebruiker")
821+
sqlx::postgres::PgTypeInfo::array_of("User")
822822
}
823823
}
824824
Ok(())

tests/postgres/setup.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ CREATE TABLE circles (
6969
EXCLUDE USING gist (c WITH &&)
7070
);
7171

72-
CREATE DOMAIN positive_int AS integer CHECK (VALUE >= 0);
72+
CREATE DOMAIN positive_int AS integer CHECK (VALUE > 0);
7373
CREATE DOMAIN percentage AS positive_int CHECK (VALUE <= 100);
7474

7575
CREATE TYPE person as (

0 commit comments

Comments
 (0)