Skip to content

Commit f1d8f8d

Browse files
committed
Improved check [skip ci]
1 parent 73acf9e commit f1d8f8d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Sources/PgvectorNIO/HalfVector.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension HalfVector: @retroactive PostgresDecodable {
2727
format: PostgresFormat,
2828
context: PostgresDecodingContext<JSONDecoder>
2929
) throws {
30-
guard type.isUserDefined else {
30+
guard type == HalfVector.psqlType, type.isUserDefined else {
3131
throw PostgresDecodingError.Code.typeMismatch
3232
}
3333

Sources/PgvectorNIO/SparseVector.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extension SparseVector: @retroactive PostgresDecodable {
3131
format: PostgresFormat,
3232
context: PostgresDecodingContext<JSONDecoder>
3333
) throws {
34-
guard type.isUserDefined else {
34+
guard type == SparseVector.psqlType, type.isUserDefined else {
3535
throw PostgresDecodingError.Code.typeMismatch
3636
}
3737

Sources/PgvectorNIO/Vector.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extension Vector: @retroactive PostgresDecodable {
2727
format: PostgresFormat,
2828
context: PostgresDecodingContext<JSONDecoder>
2929
) throws {
30-
guard type.isUserDefined else {
30+
guard type == Vector.psqlType, type.isUserDefined else {
3131
throw PostgresDecodingError.Code.typeMismatch
3232
}
3333

0 commit comments

Comments
 (0)