import { freeze } from '../util/object-utils.js' ; import { ColumnNode } from './column-node.js' ; import { IdentifierNode } from './identifier-node.js' ; import { ListNode } from './list-node.js' ; import { OperationNode } from './operation-node.js' ; import { RawNode } from './raw-node.js' ; import { TableNode } from './table-node.js' ; export type CreateIndexNodeProps = Omit < CreateIndexNode , 'kind' | 'name' > ; export type IndexType = 'btree' | 'hash' | 'gist' | 'gin' ; export interface CreateIndexNode extends OperationNode { readonly kind : 'CreateIndexNode' ; readonly name : IdentifierNode ; readonly table ? : TableNode ; readonly expression ? : ColumnNode | ListNode | RawNode ; readonly unique ? : boolean ; readonly using ? : RawNode ; } internal export const CreateIndexNode = freeze ( { is ( node ) { return node . kind === 'CreateIndexNode' ; } , create ( name ) { return freeze ( { kind : 'CreateIndexNode' , name : IdentifierNode . create ( name ) , } ) ; } , cloneWith ( node , props ) { return freeze ( { ... node , ... props , } ) ; } , } ) ;