-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add schema prefix for custom type caused fail for select and delete that prefix caused fail for insert in 0.7 #2595
Comments
I'm also running into this; I believe it's an unintended consequence of ab2ae26, since I'm working on a fix here but it's rather janky. |
PostgreSQL v15.
I have a db called
prim
, and there are two schemas calledapi
andmsg
.In
api
a enum type calleduser_status
is defined, clearly, the full name isapi.user_status
, and the structUser
has a fieldStatus
which has typeUserStatus
in Rust.In
sqlx 0.6
, I use#sqlx(type_name = "user_status")
as an attribute for typeUserStatus
in Rust code. and theselect
andinsert
operation refer to useapi.user
as full table name.But in
sqlx 0.7
,the insert raised an error says:
'type user_status' does not exist.
, so I change the attribute forUserStatus
to#[sqlx(type_name = "api.user_status")]
and work well.but select operation, an error called
mismatched types; Rust type 'api::model::user::UserStatus' (as SQL type 'api.user_status') is not compatible with SQL type 'user_status'
show there.In sql statement to create table
api.user
, the type of columnstatus
is defined asapi.user_status
.btw, in
sqlx 0.6
select and insert has no error, but insqlx 0.7
, add schema prefix for custom type caused fail for select and delete that prefix caused fail for insert.is that a bug?
The text was updated successfully, but these errors were encountered: