0.1.0 • Published 7 years ago

trailpack-wetland v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

trailpack-wetland

Wetland ORM Trailpack https://wetland.spoonx.org

Installation

  1. npm install --save trailpack-wetland
  2. Choose an adapter (list below) npm i --save sqlite3
  3. mkdir api/entity
  4. touch config/wetland.js

Configuration

Out of the box, wetland works with sqlite3, so there's no need to configure anything. An extensive list with config options and explanation can be found in the wetland documentation.

Example config

The simplest configuration (which will be what's used 9/10 times) is as follows:

config/wetland.js

const path = require('path');

module.exports.wetland = {
  entityPath: path.resolve(process.cwd(), 'api', 'entity'),
  stores    : {
    defaultStore: {
      client    : 'mysql',
      connection: {
	    host    : '127.0.0.1',
	    user    : 'your_database_user',
	    password: 'your_database_password',
	    database: 'myapp_test'
      }
    }
  }
};

Adapters

AdapterCommand
mysqlnpm i mysql --save
mysql2npm i mysql2 --save
pgnpm i pg --save
sqlite3npm i sqlite3 --save
mariasqlnpm i mariasql --save
strong-oraclenpm i strong-oracle --save
oraclenpm i oracle --save
mssqlnpm i mssql --save