Skip to content

Latest commit

 

History

History
110 lines (65 loc) · 3.46 KB

types.md

File metadata and controls

110 lines (65 loc) · 3.46 KB

Type Operations

pgm.createType( type_name, values )

Create a new data type - postgres docs

Arguments:

  • type_name [Name] - name of the new type
  • values [array of strings or object] if an array the contents are possible values for an enum type, if an object names and types for a composite type

Aliases: addType Reverse Operation: dropType


pgm.dropType( type_name )

Drop a custom data type - postgres docs

Arguments:

  • type_name [Name] - name of the new type

pgm.renameType( type_name, new_type_name )

Rename a data type - postgres docs

Arguments:

  • type_name [Name] - name of the type to rename
  • new_type_name [Name] - name of the new type

pgm.addTypeAttribute( type_name, attribute_name, attribute_type )

Add attribute to an existing data type - postgres docs

Arguments:

  • type_name [Name] - name of the type
  • attribute_name [string] - name of the attribute to add
  • attribute_type [string] - type of the attribute to add

pgm.dropTypeAttribute( type_name, attribute_name, options )

Drop attribute from a data type - postgres docs

Arguments:

  • type_name [Name] - name of the type
  • attribute_name [string] - name of the attribute to drop
  • options [object] - options:
    • ifExists [boolean] - default false

pgm.setTypeAttribute( type_name, attribute_name, attribute_type )

Set data type of an existing attribute of data type - postgres docs

Arguments:

  • type_name [Name] - name of the type
  • attribute_name [string] - name of the attribute
  • attribute_type [string] - new type of the attribute

pgm.addTypeValue( type_name, value, options )

Add value to a list of enum data type - postgres docs

Arguments:

  • type_name [Name] - name of the type
  • value [string] - value to add to list
  • options [object] - options:
    • ifNotExists [boolean] - default false
    • before [string] - value before which the new value should be add
    • after [string] - value after which the new value should be add

pgm.renameTypeAttribute( type_name, attribute_name, new_attribute_name )

Rename an attribute of data type - postgres docs

Arguments:

  • type_name [Name] - name of the type
  • attribute_name [string] - name of the attribute to rename
  • new_attribute_name [string] - new name of the attribute

pgm.renameTypeValue( type_name, value, new_value )

Rename a value of enum data type - postgres docs

Arguments:

  • type_name [Name] - name of the type
  • value [string] - value to rename
  • new_value [string] - new value