Skip to main content
Module

x/kysely_deno_postgres_dialect/mod.ts>postgres.QueryObjectOptions

Kysely dialect for PostgreSQL using the deno-postgres client.
Latest
interface postgres.QueryObjectOptions
implements QueryOptions
import { type postgres } from "https://deno.land/x/kysely_deno_postgres_dialect@v0.27.1/mod.ts";
const { QueryObjectOptions } = postgres;

Properties

optional
camelcase: boolean

Enabling camelcase will transform any snake case field names coming from the database into camel case ones

Ex: SELECT 1 AS my_field will return { myField: 1 }

This won't have any effect if you explicitly set the field names with the fields parameter

optional
fields: string[]

This parameter supersedes query column names coming from the databases in the order they were provided. Fields must be unique and be in the range of (a-zA-Z0-9_), otherwise the query will throw before execution. A field can not start with a number, just like JavaScript variables

This setting overrides the camelcase option

Ex: SELECT 'A', 'B' AS my_field with fields ["field_1", "field_2"] will return { field_1: "A", field_2: "B" }