2 ms·
>I don’t need orm, just automated mapping” Check out https://github.com/launchbadge/sqlx#sqlx-is-not-an-orm https://github.com/launchbadge/sqlx#sqlx-is-not-an-
by iknowstuff 5y ago
>I don’t need orm, just automated mapping”
Check out https://github.com/launchbadge/sqlx#sqlx-is-not-an-orm https://github.com/launchbadge/sqlx#sqlx-is-not-an-orm for an alternative approach.
struct Country { country: String, count: i64 }
let countries = sqlx::query_as!(Country, "SELECT country, count FROM countries WHERE organization = ?", organization)
.fetch_all(&db_pool)
.await?;