Skip to main content
Extremely Popular
Go to Latest
interface QueryObjectOptions
implements QueryOptions
import { type QueryObjectOptions } from "https://deno.land/x/postgres@v0.17.0/query/query.ts";

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" }