Postgresql.describeTable()

List all the columns that are found in a postgresql table.

Usage

Hover over inputs/exits for more info.

var Postgresql = require('machinepack-postgresql');


// List all the columns that are found in a postgresql table.

Postgresql.describeTable({

connectionUrl: 'postgres://foo:bar@localhost:5432/machinepack_postgresql',

table: 'direwolves',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Could not connect to Postgresql server at specified `connectionUrl`.

couldNotConnect: function () {

 

},

// Provided `table` input is not a valid name for a Postgresql table in the database.

invalidTable: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

connectionUrl required

The postgresql connection URL

'postgres://foo:bar@localhost:5432/machinepack_postgresql'
table required

The name of the table.

'direwolves'

Exits

error

An unexpected error occurred.

couldNotConnect

Could not connect to Postgresql server at specified `connectionUrl`.

invalidTable

Provided `table` input is not a valid name for a Postgresql table in the database.

success

OK.

[ { fieldName: 'birthday',
    type: 'string',
    dbType: 'timezone with timestamp',
    indexed: true,
    unique: true,
    primaryKey: false,
    autoIncrement: false } ]