Manage Assets, with node and postgres
An asset can be in three states:
npm install @matteo.collina/assets-pg --save
The factory for the assets module, you can just pass through a pg connection string.
var connString = 'postgres://localhost/assets_tests' var assets = require('@matteo.collina/assets-pg')(connString)
Adds or updates an asset. An asset can have three properties:
'id', which needs to be set only for existing assets
'status', which can be any of
The returned asset includes the
id, if missing.
Fetches an assets, returns a
new createError.NotFound() (from http-errors)
if not present.
Create the schema in PostgreSQL for this module.
Drop the schema in PostgreSQL for this module.
Ends the PG connection pool.