0.1.0 • Published 7 years ago
@clearroad/api-storage-postgresql v0.1.0
ClearRoad API Storage PostgreSQL
Note: 5 databases will be created to store the data, all prefixed with the database value (see below).
Make sure you use credentials that have the rights to create databases.
Install
npm install @clearroad/api-storage-postgresqlUsage
- Import the library:
Using with es6 / TypeScript
import { ClearRoad } from '@clearroad/api';
import storage from '@clearroad/api-storage-postgresql';Using with require
const ClearRoad = require('@clearroad/api').ClearRoad; const storage = require('@clearroad/api-storage-postgresql').default;
- Create a
ClearRoadinstance:
const options = {
localStorage: {
type: storage,
host: 'host.com',
user: 'user',
password: 'passowrd',
database: 'MyDatabase'
}
};
const cr = new ClearRoad('url', 'accessToken', options);Options
| Property | Type | Description | Required |
|---|---|---|---|
| localStorage.type | string | Connector type. Use postgresql | Yes |
| localStorage.host | string | Database host | Yes |
| localStorage.user | string | Database user | Yes |
| localStorage.password | string | Database password | Yes |
| localStorage.database | string | Database name | Yes |
| localStorage.documentsTableName | string | Database table name to storage all documents. Default is documents | No |
| localStorage.attachmentsTableName | string | Database table name to storage all attachments. Default is attachments | No |
| localStorage.timestamps | boolean | Add createdAt and updateAt fields on each row. Default is true | No |
0.1.0
7 years ago
0.1.0-alpha.9
7 years ago
0.1.0-alpha.8
7 years ago
0.1.0-alpha.7
7 years ago
0.1.0-alpha.6
7 years ago
0.1.0-alpha.5
7 years ago
0.1.0-alpha.4
7 years ago
0.1.0-alpha.3
7 years ago
0.1.0-alpha.2
7 years ago
0.1.0-alpha.1
7 years ago
0.1.0-alpha.0
7 years ago
0.0.1-rc.24
7 years ago
0.0.1-rc.23
7 years ago
0.0.1-rc.22
7 years ago