Module

x/kysely_postgrs_js_dialect/deps.ts>kysely.ColumnDefinitionBuilder#modifyFront

Kysely dialect for PostgreSQL using the Postgres.js client.
method kysely.ColumnDefinitionBuilder.prototype.modifyFront
import { kysely } from "https://dotland.deno.dev/x/kysely_postgrs_js_dialect@v0.27.3/deps.ts";
const { ColumnDefinitionBuilder } = kysely;

This can be used to add any additional SQL right after the column's data type.

Examples

db.schema.createTable('person')
 .addColumn('id', 'integer', col => col.primaryKey())
 .addColumn('first_name', 'varchar(36)', col => col.modifyFront(sql`collate utf8mb4_general_ci`).notNull())
 .execute()

The generated SQL (MySQL):

create table `person` (
  `id` integer primary key,
  `first_name` varchar(36) collate utf8mb4_general_ci not null
)

Parameters

modifier: Expression<any>