Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wetland

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wetland

An enterprise grade ORM for Node.js.

  • 1.6.0-1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-96.23%
Maintainers
1
Weekly downloads
 
Created
Source

Wetland

Build Status npm version Gitter chat

Wetland is a modern object-relational mapper (ORM) for node.js. It allows you to get started quickly, without losing flexibility or features.

New! Take a look at our wetland tutorial.

New! Wetland CLI now has its own repository. npm i -g wetland-cli.

Features

Some of the major features provided include:

  • Unit of work
  • Migrations
  • Transactions
  • Entity manager
  • Cascaded persists
  • Deep joins
  • Repositories
  • QueryBuilder
  • Entity mapping
  • Optimized state manager
  • Recipe based hydration
  • More...

Installation

To install wetland run the following command:

npm i --save wetland

Typings are provided by default for TypeScript users. No additional typings need installing.

Compatibility

  • All operating systems
  • Node.js 6.0+

Gotchas

  • When using sqlite3, foreign keys are disabled (this is due to alter table not working for foreign keys with sqlite).

Usage

The following is a snippet to give you an idea what it's like to work with wetland. For a much more detailed explanation, head to the documention..

const Wetland = require('wetland').Wetland;
const Foo     = require('./entity/foo').Foo;
const Bar     = require('./entity/foo').Bar;
const wetland = new Wetland({
  stores: {
    simple: {
      client    : 'mysql',
      connection: {
        user    : 'root',
        database: 'testdatabase'
      }
    }
  },
  entities: [Foo, Bar]
});

// Create the tables. Async process, only here as example.
// use .getSQL() (not async) in stead of apply (async) to get the queries.
let migrator = wetland.getMigrator().create();
migrator.apply().then(() => {});

// Get a manager scope. Call this method for every context (e.g. requests).
let manager = wetland.getManager();

// Get the repository for Foo
let repository = manager.getRepository(Foo);

// Get some results, and join.
repository.find({name: 'cake'}, {joins: ['candles', 'baker', 'baker.address']})
  .then(results => {
    // ...
  });

License

MIT

Keywords

FAQs

Package last updated on 25 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc