Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.27 KB

indexes.md

File metadata and controls

33 lines (23 loc) · 1.27 KB

Index Operations

pgm.createIndex( tablename, columns, options )

Create a new index - postgres docs

Arguments:

  • tablename [Name] - name of the table to alter
  • columns [string or array of strings] - columns to add to the index
  • options [index options] - optional options:
    • name [string] - name for the index (one will be inferred from table/columns if undefined)
    • unique [boolean] - set to true if this is a unique index
    • where [string] - raw sql for where clause of index
    • concurrently [boolean] - create this index concurrently
    • opclass [string] - name of an operator class to use
    • method [string] - btree | hash | gist | spgist | gin

Aliases: addIndex Reverse Operation: dropIndex


pgm.dropIndex( tablename, columns, options )

Drop an index - postgres docs

Arguments:

  • tablename [Name] - name of the table to alter
  • columns [string or array of strings] - column names, used only to infer an index name
  • options [index options] - optional options:
    • name [string] - name of the index to drop