@themost/pg
TypeScript icon, indicating that this package has built-in type declarations

2.11.0 • Public • Published

npm Dependency status for latest release GitHub top language License GitHub last commit GitHub Release Date npm

MOST Web Framework Logo

@themost/pg

Most Web Framework PostgreSQL Adapter

License: BSD-3-Clause

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 create a .env file and set DB_USER=gitpod

DB_HOST=localhost
DB_PORT=5432
DB_USER=gitpod
NODE_ENV=development

Execute npm test.

The operation will create a new test database test_db with sample data that is going to be used for testing adapter.

Package Sidebar

Install

npm i @themost/pg

Weekly Downloads

7

Version

2.11.0

License

BSD-3-Clause

Unpacked Size

390 kB

Total Files

16

Last publish

Collaborators

  • themost