Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 1759

How you are dealing with sql in rescript?

$
0
0

Shameless self plug, but I’ve built pgtyped-rescript (a ReScript fork of pgtyped) which I use in a lot of projects: pgtyped-rescript/RESCRIPT.md at rescript · zth/pgtyped-rescript · GitHub

Let’s you write SQL code inline in a type safe way (types are generated from the SQL and your DB):

let query = %sql.one(`
  SELECT * FROM books WHERE id = :id!
`)

let res = await client->query({id: 1})

// Typed according to the SQL 1query
Console.log(res)

Viewing all articles
Browse latest Browse all 1759

Trending Articles