Creating a Dynamic SQL Query Based on URL Parameters

import type { SqlClient } from "@effect/sql"
import type { URLParams } from "@template/domain/shared/adapter/URLParams"

export const buildSelectQuery = (sql: SqlClient.SqlClient, tableName: string, _urlParams: URLParams) =>
  sql`SELECT * FROM ${sql(tableName)}`

is there any way to make a dynamic query based on urlParams.fields ? code is available at https://github.com/smhmayboudi/effect-app-monorepo/
Was this page helpful?