Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.84 KB

tables.md

File metadata and controls

57 lines (36 loc) · 1.84 KB

Table Operations

pgm.createTable( tablename, columns, options )

Create a new table - postgres docs

Arguments:

  • tablename [string] - name for the new table
  • columns [object] - column names / options -- see column definitions section
  • options [object] - table options (optional)
    • temporary [bool] - default false
    • ifNotExists [bool] - default false
    • inherits [string] - table(s) to inherit from
    • constraints [object] - table constraints see add constraint
    • like [string] - table(s) to inherit from
    • comment [string] - adds comment on table

Reverse Operation: dropTable


pgm.dropTable( tablename, options )

Drop existing table - postgres docs

Arguments:

  • tablename [string] - name of the table to drop
  • options [object] - options:
    • ifExists [boolean] - drops table only if it exists
    • cascade [boolean] - drops also dependent objects

pgm.renameTable( tablename, new_tablename )

Rename a table - postgres docs

Arguments:

  • tablename [string] - name of the table to rename
  • new_table [object] - new name of the table

Reverse Operation: same operation in opposite direction


pgm.alterTable( tablename, options )

Alter existing table - postgres docs

Arguments:

  • tablename [string] - name of the table to alter
  • options [object] - options:
    • levelSecurity [string] - DISABLE, ENABLE, FORCE, or NO FORCE