
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Wetland is a modern object-relational mapper (ORM) for node.js based on the JPA-spec. It strikes a balance between ease and structure, allowing 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
.
New! Wetland has a nice entity generator. Let us do the heavy lifting. Repository can be found here.
Wetland is based on the JPA-spec and therefore has some similarities to Hibernate and Doctrine. While some aspects of the ORM have been adapted to perform better in the Node.js environment and don't follow the specification to the letter for that reason, the JPA specification is a stable and well written specification that makes wetland structured and performant.
Some of the major features provided include:
To install wetland run the following command:
npm i --save wetland
Typings are provided by default for TypeScript users. No additional typings need installing.
npm i -g wetland-cli
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 documentation..
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 => {
// ...
});
const { UserRepository } = require('../repository/UserRepository');
class User {
static setMapping(mapping) {
// Adds id, updatedAt and createdAt for your convenience.
mapping.autoFields();
mapping.entity({ repository: UserRepository })
mapping.field('dateOfBirth', { type: 'datetime' });
}
}
module.exports.User = User;
import { entity, autoFields, field } from 'wetland';
import { UserRepository } from '../repository/UserRepository';
@entity({ repository: UserRepository })
@autoFields()
export class User {
@field({ type: 'datetime' })
public dateOfBirth: Date;
}
MIT
FAQs
A modern object-relational mapper (ORM) for node.js.
The npm package wetland receives a total of 22 weekly downloads. As such, wetland popularity was classified as not popular.
We found that wetland demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.