/
opt
/
canhelp
/
node_modules
/
kysely
/
dist
/
cjs
/
schema
/
/opt/canhelp/node_modules/kysely/dist/cjs/schema
mkdir
upload
Name
Size
Mode
Actions
alter-column-builder.d.ts
1949
0644
edit
dl
rm
alter-column-builder.js
2681
0644
edit
dl
rm
alter-table-add-foreign-key-constraint-builder.d.ts
1860
0644
edit
dl
rm
alter-table-add-foreign-key-constraint-builder.js
2617
0644
edit
dl
rm
alter-table-add-index-builder.d.ts
4248
0644
edit
dl
rm
alter-table-add-index-builder.js
5385
0644
edit
dl
rm
alter-table-builder.d.ts
7154
0644
edit
dl
rm
alter-table-builder.js
13810
0644
edit
dl
rm
alter-table-drop-constraint-builder.d.ts
1193
0644
edit
dl
rm
alter-table-drop-constraint-builder.js
2338
0644
edit
dl
rm
alter-table-executor.d.ts
819
0644
edit
dl
rm
alter-table-executor.js
688
0644
edit
dl
rm
check-constraint-builder.d.ts
655
0644
edit
dl
rm
check-constraint-builder.js
538
0644
edit
dl
rm
column-definition-builder.d.ts
14056
0644
edit
dl
rm
column-definition-builder.js
18434
0644
edit
dl
rm
create-index-builder.d.ts
6063
0644
edit
dl
rm
create-index-builder.js
6500
0644
edit
dl
rm
create-schema-builder.d.ts
1059
0644
edit
dl
rm
create-schema-builder.js
1199
0644
edit
dl
rm
create-table-builder.d.ts
11121
0644
edit
dl
rm
create-table-builder.js
14746
0644
edit
dl
rm
create-type-builder.d.ts
1236
0644
edit
dl
rm
create-type-builder.js
1344
0644
edit
dl
rm
create-view-builder.d.ts
2101
0644
edit
dl
rm
create-view-builder.js
3422
0644
edit
dl
rm
drop-index-builder.d.ts
1219
0644
edit
dl
rm
drop-index-builder.js
1866
0644
edit
dl
rm
drop-schema-builder.d.ts
1074
0644
edit
dl
rm
drop-schema-builder.js
1437
0644
edit
dl
rm
drop-table-builder.d.ts
1065
0644
edit
dl
rm
drop-table-builder.js
1425
0644
edit
dl
rm
drop-type-builder.d.ts
1024
0644
edit
dl
rm
drop-type-builder.js
1186
0644
edit
dl
rm
drop-view-builder.d.ts
1093
0644
edit
dl
rm
drop-view-builder.js
1650
0644
edit
dl
rm
foreign-key-constraint-builder.d.ts
1462
0644
edit
dl
rm
foreign-key-constraint-builder.js
2060
0644
edit
dl
rm
primary-key-constraint-builder.d.ts
897
0644
edit
dl
rm
primary-key-constraint-builder.js
1440
0644
edit
dl
rm
refresh-materialized-view-builder.d.ts
1954
0644
edit
dl
rm
refresh-materialized-view-builder.js
2668
0644
edit
dl
rm
schema.d.ts
6271
0644
edit
dl
rm
schema.js
10763
0644
edit
dl
rm
unique-constraint-builder.d.ts
1069
0644
edit
dl
rm
unique-constraint-builder.js
1709
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/kysely/dist/cjs/schema/create-index-builder.d.ts
(6063B)
import { CreateIndexNode, type IndexType } from '../operation-node/create-index-node.js'; import type { OperationNodeSource } from '../operation-node/operation-node-source.js'; import { type ExtractColumnNameFromOrderedColumnName, type OrderedColumnName } from '../parser/reference-parser.js'; import type { CompiledQuery } from '../query-compiler/compiled-query.js'; import type { Compilable } from '../util/compilable.js'; import type { QueryExecutor } from '../query-executor/query-executor.js'; import type { QueryId } from '../util/query-id.js'; import type { Expression } from '../expression/expression.js'; import { type ComparisonOperatorExpression } from '../parser/binary-operation-parser.js'; import type { ExpressionBuilder } from '../expression/expression-builder.js'; import type { ShallowRecord, SqlBool } from '../util/type-utils.js'; export declare class CreateIndexBuilder<C = never> implements OperationNodeSource, Compilable { #private; constructor(props: CreateIndexBuilderProps); /** * Adds the "if not exists" modifier. * * If the index already exists, no error is thrown if this method has been called. */ ifNotExists(): CreateIndexBuilder<C>; /** * Makes the index unique. */ unique(): CreateIndexBuilder<C>; /** * Adds `nulls not distinct` specifier to index. * This only works on some dialects like PostgreSQL. * * ### Examples * * ```ts * db.schema.createIndex('person_first_name_index') * .on('person') * .column('first_name') * .nullsNotDistinct() * .execute() * ``` * * The generated SQL (PostgreSQL): * * ```sql * create index "person_first_name_index" * on "test" ("first_name") * nulls not distinct; * ``` */ nullsNotDistinct(): CreateIndexBuilder<C>; /** * Specifies the table for the index. */ on(table: string): CreateIndexBuilder<C>; /** * Adds a column to the index. * * Also see {@link columns} for adding multiple columns at once or {@link expression} * for specifying an arbitrary expression. * * ### Examples * * ```ts * await db.schema * .createIndex('person_first_name_and_age_index') * .on('person') * .column('first_name') * .column('age desc') * .execute() * ``` * * The generated SQL (PostgreSQL): * * ```sql * create index "person_first_name_and_age_index" on "person" ("first_name", "age" desc) * ``` */ column<CL extends string>(column: OrderedColumnName<CL>): CreateIndexBuilder<C | ExtractColumnNameFromOrderedColumnName<CL>>; /** * Specifies a list of columns for the index. * * Also see {@link column} for adding a single column or {@link expression} for * specifying an arbitrary expression. * * ### Examples * * ```ts * await db.schema * .createIndex('person_first_name_and_age_index') * .on('person') * .columns(['first_name', 'age desc']) * .execute() * ``` * * The generated SQL (PostgreSQL): * * ```sql * create index "person_first_name_and_age_index" on "person" ("first_name", "age" desc) * ``` */ columns<CL extends string>(columns: OrderedColumnName<CL>[]): CreateIndexBuilder<C | ExtractColumnNameFromOrderedColumnName<CL>>; /** * Specifies an arbitrary expression for the index. * * ### Examples * * ```ts * import { sql } from 'kysely' * * await db.schema * .createIndex('person_first_name_index') * .on('person') * .expression(sql`first_name COLLATE "fi_FI"`) * .execute() * ``` * * The generated SQL (PostgreSQL): * * ```sql * create index "person_first_name_index" on "person" (first_name COLLATE "fi_FI") * ``` */ expression(expression: Expression<any>): CreateIndexBuilder<C>; /** * Specifies the index type. */ using(indexType: IndexType): CreateIndexBuilder<C>; using(indexType: string): CreateIndexBuilder<C>; /** * Adds a where clause to the query. This Effectively turns the index partial. * * ### Examples * * ```ts * 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): * * ```sql * create index "orders_unbilled_index" on "orders" ("order_nr") where "billed" is not true and "order_nr" like '123%' * ``` * * Column names specified in {@link column} or {@link 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 {@link sql} * expressions. * * Parameters are always sent as literals due to database restrictions. */ where(lhs: C | Expression<any>, op: ComparisonOperatorExpression, rhs: unknown): CreateIndexBuilder<C>; where(factory: (qb: ExpressionBuilder<ShallowRecord<string, ShallowRecord<C & string, any>>, string>) => Expression<SqlBool>): CreateIndexBuilder<C>; where(expression: Expression<SqlBool>): CreateIndexBuilder<C>; /** * Simply calls the provided function passing `this` as the only argument. `$call` returns * what the provided function returns. */ $call<T>(func: (qb: this) => T): T; toOperationNode(): CreateIndexNode; compile(): CompiledQuery; execute(): Promise<void>; } export interface CreateIndexBuilderProps { readonly queryId: QueryId; readonly executor: QueryExecutor; readonly node: CreateIndexNode; }
Save
cmd:
run