I am using Rescript v11 to bind the Postgress.js API. Since returned by the “make” binding is a tagged Template function , I cannot use @taggedTemplate to descript it. The generated js file is not with tagged Template. How can I use @taggedTemplate so that gen the js code with tagged Template ?
[GitHub - porsager/postgres: Postgres.js]
(GitHub - porsager/postgres: Postgres.js - The Fastest full featured PostgreSQL client for Node.js, Deno, Bun and CloudFlare)
bind
type t<'sqlParam, 'data> = (array<string>, array<'sqlParam>) => promise<result<'data>>
@module("postgres") external make: (~url: string, ~config: config=?) => t<'sqlParam, 'data> = "default"
usage
let sql = Postgresql.make(~url="postgres://xxx:xxxx@localhost:5432/xxxxxx")
let abc = "abc"
let result: Postgresql.result<userInfo> = await sql`select name, sigup_date from user_tbl where name=${ abc }`
output:
var result = await sql([
"select name, sigup_date from user_tbl where name=",
""
], ["abc"]);