import { kysely } from "https://deno.land/x/kysely_postgrs_js_dialect@v0.27.4/mod.ts";
const { CreateIndexBuilder } = kysely;
Adds a where clause to the query. This Effectively turns the index partial.
Examples
import { sql } from 'kysely'
await db.schema
.createIndex('orders_unbilled_index')
.on('orders')
.column('order_nr')
.where(sql.ref('billed'), 'is not', true)
.where('order_nr', 'like', '123%')
The generated SQL (PostgreSQL):
create index "orders_unbilled_index" on "orders" ("order_nr") where "billed" is not true and "order_nr" like '123%'
Column names specified in column or columns are known at compile-time and can be referred to in the current query and context.
Sometimes you may want to refer to columns that exist in the table but are not part of the current index. In that case you can refer to them using sql expressions.
Parameters are always sent as literals due to database restrictions.
Parameters
factory: (qb: ExpressionBuilder<ShallowRecord<string, ShallowRecord<C & string, any>>, string>) => Expression<SqlBool>
Parameters
expression: Expression<SqlBool>