News for hackers. Stuff that matters.
Re:Back to basics: Writing an application using Go and Postg... by iknowstuff on Monday November 22, 2021 @11:32PM (#29314621)
>I don’t need orm, just automated mapping”

Check out 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?;

There are no comments on this comment yet.