effect
effect copied to clipboard
Pass parameters to SQL query string in @effect/sql
What is the problem this feature would solve?
Querying raw SQL strings that contains standard SQL parameters (@k
, $1
, :k
)
What is the feature you are proposing to solve the problem?
Add exec(sql: string, params: Segment[] | Record<string, Segment>)
method to SqlClient
.
What alternatives have you considered?
Calling database library directly and preparing statement by hand before sending them (applicable to SQLite clients like better-sqlite3, Bun built-in client, and upcoming Node's client)