https://github.com/themost-framework/pg
MOST Web Framework PostgreSQL Data Adapter
https://github.com/themost-framework/pg
Last synced: about 2 months ago
JSON representation
MOST Web Framework PostgreSQL Data Adapter
- Host: GitHub
- URL: https://github.com/themost-framework/pg
- Owner: themost-framework
- License: bsd-3-clause
- Created: 2022-02-27T16:30:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-09T09:50:59.000Z (4 months ago)
- Last Synced: 2025-03-31T06:41:21.666Z (3 months ago)
- Language: JavaScript
- Size: 1.11 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.npmjs.com/package/@themost%2Fpg)


[](https://github.com/themost-framework/themost/blob/master/LICENSE)


[](https://www.npmjs.com/package/@themost%2Fpg)
@themost/pg
===========Most Web Framework PostgreSQL Adapter
License: [BSD-3-Clause](https://github.com/themost-framework/pg/blob/master/LICENSE)
## Installation
npm install @themost/pg
## Usage
Register PostgreSQL adapter on app.json as follows:
"adapterTypes": [
...
{ "name":"PostgreSQL Data Adapter", "invariantName": "postgres", "type":"@themost/pg" }
...
],
adapters: {
"postgres": { "name":"local-db", "invariantName":"postgres", "default":true,
"options": {
"host":"localhost",
"post":5432,
"user":"user",
"password":"password",
"database":"db"
}
}
}## Testing
Clone project and create a `.env` file to set testing environment variables
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=pass
NODE_ENV=development(*) DB_PASSWORD is optional
If you are using [Gitpod](https://www.gitpod.io/) create a `.env` file and set `DB_USER=gitpod`
DB_HOST=localhost
DB_PORT=5432
DB_USER=gitpod
NODE_ENV=developmentExecute `npm test`.
The operation will create a new test database `test_db` with sample data that is going to be used for testing adapter.