-
sqlx
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite. (by launchbadge)
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Hey guys, needed some help with fetching and mapping relations from postgres to rust objects using sqlx. I did find this thread which shows a lot of great tricks on how to manipulate relations in sqlx - https://github.com/launchbadge/sqlx/issues/1014 However my issue is that the sqlx::Type macro requires non optional fields in structs. So I'm currently thinking that I can query for the object with just its primary fields and then attach the relation later from another query but that fails because the query_as! macro checks my struct and tries to validate the structure with the database table and that fails because there is an additional relation struct that is not part of the table.
Related posts
-
A tale of TimescaleDB, SQLx and testing in Rust
-
SQLX MSSQL Connection String Problem
-
SQLx 0.7 released! Offline mode usability improvements, performance fixes and major upgrades across the board!
-
MariaDB / SQLx - "Unknown Authentication Plugin"
-
What do you think about macros that use remote source to calculate its result?