-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
E-easydb:postgresRelated to PostgreSQLRelated to PostgreSQLgood first issueGood for newcomersGood for newcomersmacros
Description
Hi, I'm sure this is probably some configuration error on my end, but am not sure what to do.
I have my project compiling perfectly on my local machine with the compile-time query checks, but when I deploy it to my server I start getting these errors:
error: error occurred while decoding column 0: mismatched types; Rust type `sqlx_core::types::json::Json<[sqlx_core::postgres::connection::describe::Explain; 1]>` (as SQL type `JSONB`) is not compatible with SQL type `TEXT`
--> src/handlers/users.rs:22:5
|
22 | / sqlx::query_as!(
23 | | User,
24 | | "INSERT INTO users (email, auth0_subject, created_at) VALUES ($1, $2, $3) RETURNING *",
25 | | user.email.as_str(),
26 | | user.sub.as_str(),
27 | | chrono::Local::now().naive_local()
28 | | )
| |_____^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info
I checked the schema of the users table in both my local and server db but they both just look like:
theblackrose=# SELECT column_name, data_type FROM information_schema.columns WHERE TABLE_NAME = 'users';
column_name | data_type
---------------+-----------------------------
id | integer
auth0_subject | text
email | text
created_at | timestamp without time zone
(4 rows)
Can someone point me in a direction to what I might be missing ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
E-easydb:postgresRelated to PostgreSQLRelated to PostgreSQLgood first issueGood for newcomersGood for newcomersmacros