Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 2.06 KB

views.md

File metadata and controls

67 lines (42 loc) · 2.06 KB

View Operations

pgm.createView( viewName, options, definition )

Create a new view - postgres docs

Arguments:

  • viewName [Name] - name of the new view
  • options [object] - options:
    • temporary [boolean] - default false
    • replace [boolean] - default false
    • recursive [boolean] - default false
    • columns [string or array] - use if you want to name columns differently then inferred from definition
    • checkOption [string] - CASCADED or LOCAL
  • definition [string] - SQL of SELECT statement

Reverse Operation: dropView


pgm.dropView( viewName, options )

Drop a view - postgres docs

Arguments:

  • viewName [Name] - name of the view to delete
  • options [object] - options:
    • ifExists [boolean] - drops view only if it exists
    • cascade [boolean] - drops also dependent objects

pgm.alterView( viewName, options )

Alter a view - postgres docs

Arguments:

  • viewName [Name] - name of the view to alter
  • options [object] - options:
    • checkOption [string] - CASCADED, LOCAL or null to drop

pgm.alterViewColumn( viewName, columnName, options )

Alter a view column - postgres docs

Arguments:

  • viewName [Name] - name of the view to alter
  • columnName [string] - name of the column to alter
  • options [object] - options:
    • default [string] - default value of column

pgm.renameView( viewName, newViewName )

Rename a view - postgres docs

Arguments:

  • viewName [Name] - old name of the view
  • newViewName [Name] - new name of the view