postgresql@6.1.2
- describeTable(tableName, [options], callback)
- findValue([filter])
- insert(table, record, [options], callback)
- insertMany(table, records, [options], callback)
- insertTable(tableName, columns, [options], callback)
- modifyTable(tableName, columns, [options], callback)
- sql(sqlQuery, [options], callback)
- upsert(table, uuid, record, [options], callback)
- upsertIf(logical, table, uuid, record, [options], callback)
- upsertMany(table, uuid, data, [options], callback)
This adaptor exports the following from common:
- alterState()
- arrayToString()
- as()
- combine()
- dataPath()
- dataValue()
- dateFns
- each()
- field()
- fields()
- fn()
- fnIf()
- group()
- http
- lastReferenceValue()
- merge()
- sourceValue()
Functions
describeTable
describeTable(tableName, [options], callback) ⇒ Operation
List the columns of a table in a database.
Param | Type | Description |
---|---|---|
tableName | string | The name of the table to describe |
[options] | object | Optional options argument |
[options.writeSql] | boolean | A boolean value that specifies whether to log the generated SQL statement. Defaults to false. |
[options.execute] | boolean | A boolean value that specifies whether to execute the generated SQL statement. Defaults to false. |
callback | function | (Optional) callback function |
Example
describeTable('clinic_visits')
findValue
findValue([filter]) ⇒ value
Fetch a uuid key given a condition
Param | Type | Description |
---|---|---|
[filter] | object | A filter object with the lookup table, a uuid and the condition |
[filter.uuid] | string | The uuid value to search for in the specified relation. |
[filter.relation] | string | The name of the relation to search for the uuid value. |
[filter.where] | object | An object that contains key-value pairs to filter the search results. |
[filter.operator] | object | An object that contains key-value pairs to specify the type of comparison to perform on the where clause. |
Example
findValue({
uuid: 'id',
relation: 'users',
where: { first_name: 'Mamadou' },
operator: { first_name: 'like' }
})