interface

SQL.Transform

interface Transform

The transform option

const sql = new SQL({ transform: SQL.camel });
await sql`INSERT INTO users ${sql({ firstName: "Alice" })}`; // "first_name"
const [user] = await sql`SELECT first_name FROM users`;
console.log(user.firstName);
  • column?: ColumnTransform | (name: string) => string

    Renames columns. A function means ColumnTransform.from.

  • undefined?: unknown

    The value that Bun sends for an undefined parameter. When it is set (null counts), the insert and update helpers leave no column out. Without it, undefined is NULL, and the helpers leave out a column that is undefined.