Skip to content

Commit ecb6feb

Browse files
Merge pull request #2519 from nolanlawson/create-index
fix: improve types for `CREATE INDEX`
2 parents 7d85ce2 + e2e9dbf commit ecb6feb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

types.d.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export interface ValueExpr<T = string | number | boolean> {
100100
value: T;
101101
}
102102

103-
export type SortDirection = 'ASC' | 'DESC';
103+
export type SortDirection = 'ASC' | 'DESC' | 'asc' | 'desc';
104104

105105
export interface ColumnRefItem {
106106
type: "column_ref";
@@ -480,7 +480,7 @@ export interface Create {
480480
type: "create";
481481
keyword: "aggregate" | "table" | "trigger" | "extension" | "function" | "index" | "database" | "schema" | "view" | "domain" | "type" | "user";
482482
temporary?: "temporary" | null;
483-
table?: { db: string; table: string }[];
483+
table?: { db: string; table: string }[] | { db: string | null, table: string };
484484
if_not_exists?: "if not exists" | null;
485485
like?: {
486486
type: "like";
@@ -496,9 +496,9 @@ export interface Create {
496496
keyword: "using";
497497
type: "btree" | "hash";
498498
} | null;
499-
index?: string | null;
499+
index?: string | null | { schema: string | null, name: string};
500500
on_kw?: "on" | null;
501-
index_columns?: any[] | null;
501+
index_columns?: ColumnRefItem[] | null;
502502
index_type?: "unique" | "fulltext" | "spatial" | null;
503503
index_options?: any[] | null;
504504
algorithm_option?: {
@@ -517,6 +517,7 @@ export interface Create {
517517
} | null;
518518
database?: string;
519519
loc?: LocationRange;
520+
where?: Binary | Function | null
520521
}
521522

522523
export interface Drop {

0 commit comments

Comments
 (0)