classedql
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

ClassedQL

ClassedQL is a promise-based Node.js ORM for MySQL.

Installation

npm install --save classedql

Usage

const ClassedQL = require('classedql').default;
const { Collection, DataTypes } = require('classedql');
 
class User extends Collection {}
 
User.build({
  id: {
    type: DataTypes.BIGINTEGER.set({ length: 20, unsigned: true }),
    length: 20,
    auto_increment: true,
    primary_key: true,
    comment: 'identity of the row',
  },
  name: {
    type: DataTypes.CHAR.set({ length: 60 }),
    length: 20,
    null: true,
  },
});
 
const connection = new ClassedQL('database', 'user', 'password');
 
connection.initialize({ User });

Resources

Package Sidebar

Install

npm i classedql

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

27 kB

Total Files

25

Last publish

Collaborators

  • gokuzhan