An adapter-based ORM for Node.js with support for mysql, mongo, postgres, mssql (SQL Server), and more

Related tags

Database waterline
Overview

Waterline logo

Master Branch Build Status Master Branch Build Status (Windows) StackOverflow (waterline) StackOverflow (sails)

Waterline is a next-generation storage and retrieval engine, and the default ORM used in the Sails framework.

It provides a uniform API for accessing stuff from different kinds of databases and protocols. That means you write the same code to get and store things like users, whether they live in MySQL, MongoDB, neDB, or Postgres.

Waterline strives to inherit the best parts of ORMs like ActiveRecord, Hibernate, and Mongoose, but with a fresh perspective and emphasis on modularity, testability, and consistency across adapters.

No more callbacks

Starting with v0.13, Waterline takes full advantage of ECMAScript & Node 8's await keyword.

In other words, no more callbacks.

var newOrg = await Organization.create({
  slug: 'foo'
})
.fetch();

Looking for the version of Waterline used in Sails v0.12? See the 0.11.x branch of this repo. If you're upgrading to v0.13 from a previous release of Waterline standalone, take a look at the upgrading guide.

Installation

Install from NPM.

  $ npm install waterline

Overview

Waterline uses the concept of an adapter to translate a predefined set of methods into a query that can be understood by your data store. Adapters allow you to use various datastores such as MySQL, PostgreSQL, MongoDB, Redis, etc. and have a clear API for working with your model data.

Waterline supports a wide variety of adapters, both core and community maintained.

Usage

The up-to-date documentation for Waterline is maintained on the Sails framework website. You can find detailed API reference docs under Reference > Waterline ORM. For conceptual info (including Waterline standalone usage), and answers to common questions, see Concepts > Models & ORM.

Help

Check out the recommended community support options for tutorials and other resources. If you have a specific question, or just need to clarify how something works, ask for help or reach out to the core team directly.

You can keep up to date with security patches, the Waterline release schedule, new database adapters, and events in your area by following us (@sailsjs) on Twitter.

Bugs   NPM version

To report a bug, click here.

Contribute

Please observe the guidelines and conventions laid out in our contribution guide when opening issues or submitting pull requests.

Tests

All tests are written with mocha and should be run with npm:

  $ npm test

License

MIT. Copyright © 2012-present Mike McNeil & The Sails Company

Waterline, like the rest of the Sails framework, is free and open-source under the MIT License.

image_squidhome@2x.png

Comments
  • create beforeFind lifecycle callback

    create beforeFind lifecycle callback

    I created a beforeFind lifecycle callback to allow a user to always modify a model's find or findOne queries with some criteria. A good use case would be if you're using a soft-delete system and you'd like to tack on an isDeleted:false to any find query on a model. Please feel free to critique the code/suggest changes, I tried to stick to the style that already exists.

    opened by aclave1 46
  • Switch promises from Q to Bluebird

    Switch promises from Q to Bluebird

    While Q is a great library for Promises, Bluebird promises are almost as fast as callbacks, and even faster than callbacks when using generators, while Q tends to take up a lot of extra memory and runs much slower. Bluebird also has much more detailed stack traces.

    Changes:

    • Replace Q with Bluebird
    • Replace .fail with .catch
    opened by jamiebuilds 32
  • Hotfix/update on create

    Hotfix/update on create

    This PR makes it so that:

    • You can view the diff on a model
    • You don't get afterUpdate to trigger on create
    • You don't get an update at all, on create (because there's no diff)
    • .save() only updates changed fields, in stead of everything
    • There's no association cache anymore
    • The original values are retrievable on the model.

    Notes to self

    • ~~.compareModelValues() in save.js can probably go.~~
    • ~~.findPrimaryKey() can probably go. Context has a primaryKey property.~~
    • ~~Don't forget to set status back to clean after various save operations.~~
    feature (please submit proposal) 
    opened by RWOverdijk 28
  • [feature] Add Multi-Tenant support

    [feature] Add Multi-Tenant support

    About

    Support Multitenancy by using dynamically loaded Tenant-specific collections and their corresponding connections.

    Example App with Multitenancy

    See https://github.com/Glavin001/sails-multitenancy-example

    How It Works

    The call to Collection.tenant will return a tenant-specific collection. This collection has a scoped identity for each tenant and the tenant name could be a number of string. For instance, Collection with identity test would becoming test<tenant:1> for Test.tenant(1).

    The Tenant-specific Collection also has it's own Tenant-specific Connection with an analogous naming convention: connectionName<tenant:tenantId>.

    These new Tenant-specific collections and connections are loaded dynamically, on-demand, at runtime. This means that you:

    1. do not require waiting to load all X number of connections for all of your tenants, and
    2. do not even have to know at server startup what tenants are available. They could even be loaded from a database upon request, without reloading your server!

    Related Issues

    See #286 and https://github.com/balderdashy/sails-mongo/issues/130 and https://github.com/balderdashy/sails/issues/1857

    Usage

    Configure Connection

          'my_foo': {
            adapter: 'foo',
            host: 'localhost',
            port: 12345,
            database: 'default_database',
    
            // === New ===
            isMultiTenant: true, // Enable Multi-Tenancy feature
            defaultTenant: false, // false, <string>, or <number>
            getTenant: function(req, cb) { // For Sailsjs
              return cb(req.params.tenant);
            },
            configForTenant: function(tenantId, config, cb) { // For Waterline
              // Validate Tenant
              tenantId = parseInt(tenantId);
              if (tenantId >= 1 && tenantId < 10) {
                config.database = "tenant-" + tenantId;
                return cb(null, config);
              } else {
                // 
                return cb(new Error("Invalid tenant " + tenantId + "!"));
              }
            }
    
          }
    

    .tenant API

    Currently Supported

    • [x] Callback-style
          Collection
            .tenant("1", function(err, TenantCollection) {
              // Now you have a Tenant-specific Collection!
              TenantCollection
                .find({})
                .exec(function(err, results) {
                  assert(results.length === 1, 'tenant-1 has 1 record');
                  assert(results[0].message === db['tenant-1']['tests'][0].message, 'records are from the tenant-1 database');
                  done();
                });
            });
    
    • Promise-style, using
      • [x] Operations
        • Used by finders
      • [x] Deferred
        • Used by count, create, destroy, update
          Collection
            .tenant("1")
            .find({})
            .exec(function(err, result) {
              console.log(err, result);
              done();
            });
    

    Tests:

    See https://github.com/Glavin001/waterline/blob/multi-tenant/lib/waterline/query/dql/tenant.js

    • [x] Callback-style API
      • [x] find
      • [x] findOne
      • [x] count
      • [x] create
      • [x] destroy
      • [x] update
    • [x] Promise-style API (Operation/Deferred)
      • [x] find
      • [x] findOne
      • [x] count
      • [x] create
      • [x] destroy
      • [x] update

    TODO:

    • [x] Use existing Tenant connection, if previously loaded
    • [x] Use existing Tenant Collection, if previously loaded
    • [x] Remove debugging console.log
    • Add support for Promise-style API (see above)
    • Add support to Sailsjs Blueprints for using this Multi-Tenancy feature
      • Sailsjs would use the .getTenant(req, callback) as defined in the configuration
    • [x] Improve documentation
    • [ ] Joins/associations across multiple multi-tenant Collections
      • Apply the same tenant to both, if either have multi-tenant enabled
    • [ ] Allow for the Adapter to change between Tenants
      • See https://github.com/Glavin001/waterline/blob/multi-tenant/lib/waterline/connections/index.js#L67 and https://github.com/Glavin001/waterline/blob/multi-tenant/lib/waterline/query/dql/tenant.js#L182
    opened by Glavin001 24
  • Add eslint for source code

    Add eslint for source code

    I think @Globegitter has been pretty busy lately, so this is an offer to implement just the linting part of https://github.com/balderdashy/waterline/pull/935. I am willing to go through and try to fix failing rules, but I would like to get consensus on what the rules should be prior to spending the effort. With the rules from https://github.com/balderdashy/waterline/pull/935 (currently in this PR), I get the following results:

    screenshot from 2015-06-27 22 28 28

    (Note that all these screenshots are cropped on the right, a few bars are much longer)

    Another strategy to avoid bikeshedding and arguing over rules, would be to use eslint-config-standard. With that set of rules, these are the results:

    screenshot from 2015-06-27 22 38 18

    My suggestion would be to override the following rules to more closely align with the existing codebase:

    "rules": {
      "space-before-function-paren":  [2, "never"],
      "space-after-keywords":         [2, "never"],
      "semi":                         [2, "always"]
    }
    

    The results of these three changes results in something pretty manageable:

    modified-standard

    What say ye?

    opened by IanVS 21
  • Added ability to specify what to populate on save()

    Added ability to specify what to populate on save()

    This is the same as https://github.com/balderdashy/waterline/pull/954 but with the function signature changed to have cb as the last parameter.

    All credit to @nkibler7.

    feature (please submit proposal) 
    opened by tobalsgithub 21
  • FindAndModify + upsert

    FindAndModify + upsert

    As mentioned by @dmarcelino in https://github.com/balderdashy/waterline/pull/939 a PR against the 0.11 branch.

    I know there is the current discussion going on about findOrCreateEach ( https://github.com/balderdashy/waterline/issues/931) so it might not have been the wisest choice to add a findAndModifyEach but I needed a findAndModify functionality (see http://docs.mongodb.org/manual/reference/method/db.collection.findAndModify/) and it seemed like a good solution to put it such a way that other people can use it as well.

    Usage is Model.findAndModify(search critieras, values, [options, cb]);

    where-as default options look like that:

    {
      upsert: false, // on true automatically inserts the values if nothing is found
      new: true, // if false returns the model before it was updated/created
      mergeArrays: false // quite a special case that I needed and I am still testing in my app. When any of the values given contain an array it is merged to the found object rather than just replaced.
    }
    

    I added passing unit tests as well as adapter-tests, see https://github.com/balderdashy/waterline-adapter-tests/pull/47 There is something strange going on, even though the findAndModify passes the unit tests and works in my app (via npm i git+https://github.com/Globegitter/waterline.git#findAndModify) the adapter-tests do not pass and throw the same error throughout:

    9) Semantic Interface .findAndModfiy() should return a model instance:
         TypeError: undefined is not a function
          at Context.<anonymous> (Git/waterline/node_modules/waterline-adapter-tests/interfaces/semantic/findAndModify.test.js:73:20)
          at Test.Runnable.run (Git/waterline/node_modules/waterline-adapter-tests/node_modules/mocha/lib/runnable.js:194:15)
          at Runner.runTest (Git/waterline/node_modules/waterline-adapter-tests/node_modules/mocha/lib/runner.js:355:10)
          at Git/waterline/node_modules/waterline-adapter-tests/node_modules/mocha/lib/runner.js:401:12
          at next (Git/waterline/node_modules/waterline-adapter-tests/node_modules/mocha/lib/runner.js:281:14)
          at Git/waterline/node_modules/waterline-adapter-tests/node_modules/mocha/lib/runner.js:290:7
          at next (Git/waterline/node_modules/waterline-adapter-tests/node_modules/mocha/lib/runner.js:234:23)
          at Immediate._onImmediate (Git/waterline/node_modules/waterline-adapter-tests/node_modules/mocha/lib/runner.js:258:5)
          at processImmediate [as _immediateCallback] (timers.js:361:17)
    

    I have no idea why this happens or how to fix this. So apart from if this actually gets merged, anyone got any idea of why that could be?

    Also it does not work completely in my app via sails-postgresql, I seem to be getting this error. I am not sure if that is related to my code or to sails-postgresql.

    db_1     | ERROR:  syntax error at or near "LIMIT" at character 140
    db_1     | STATEMENT:  UPDATE "subject" AS "subject" SET "researchIds" = $1, "text" = $2, "createdAt" = $3, "updatedAt" = $4  WHERE LOWER("subject"."text") = $5  LIMIT 1 RETURNING *
    
    question 
    opened by Globegitter 20
  • [fixes #1444] Model.findOrCreate() should send back an object without {fetch: true} meta

    [fixes #1444] Model.findOrCreate() should send back an object without {fetch: true} meta

    Waterline version: 0.13.0-3 Node version: v7.5.0 NPM version: 4.1.2 Operating system: macOS 10.12.3 (16D32)


    Hello,

    I'm trying to use latest version of waterline with SailsJS 1.0.0-22, and found a problem with Model.findOrCreate(). It behaves the same as Model.create() rather than Model.find(), i.e it requires {fetch: true} meta to return a created/found object.

    Model.findOrCreate({ type: 'dog' }, { name: 'Pretend pet type', type: 'dog' }).then(console.log);
    // undefined
    
    Model.findOrCreate({ type: 'dog' }, { name: 'Pretend pet type', type: 'dog' }).meta({fetch: true}).then(console.log);
    // { id: 1, name: 'Pretend pet type', type: 'dog' }
    
    opened by mrded 17
  • Call beforeUpdate, beforeDestroy, beforeValidate callbacks with criteria

    Call beforeUpdate, beforeDestroy, beforeValidate callbacks with criteria

    Pass criteria to the beforeUpdate, beforeDestroy, and beforeValidate callbacks, before the callback param.

    In beforeValidate callbacks, criteria is null for create operations.

    Serves as a solution to issue #1004.

    NOTE: For backwards compatibility, it now checks if the beforeValidate or beforeCreate callback(s) only accept 3 arguments or beforeDestroy accepts only 2 and if so, passes the callback as the last argument and omits criteria.

    Example usage and explanation:

    // User.js
    module.exports = {
      attributes: {
        email: { type: 'email', required: true, unique: true },
        password: { type: 'string', required: true }
      },
    
      /**
       * Hashes the password if it is provided
       * @param {Object} values The data submitted via the API
       * @param {Function} next The callback to invoke when done, with optional error
       */
      beforeCreate: function (values, next) {
        if (values.password === undefined) return next();
        hashPassword(values.password, function (err, hash) {
          if (err) return next(err);
          values.password = hash;
          next();
        });
      },
    
      /**
       * Hashes the password if it is provided, but only if the provided
       * password is not the user's existing password hash (safeguards
       * against the record.save() bug)
       * @param {Object} values The values to update
       * @param {Object} criteria The criteria to match the record(s) to update
       * @param {Function} next The callback to invoke when done, with optional error
       */
      beforeUpdate: function (values, criteria, next) {
        if (values.password === undefined) return next();
    
        // Look up user and only change password if values.password isn't the hash
        User.findOne(criteria).exec(function (err, user) {
          if (err) return next(err);
          if (!user) return next(new Error('User to update does not seem to exist!'));
    
          if (values.password === user.password) return next();
    
          hashPassword(values.password, function (err, hash) {
            if (err) return next(err);
            values.password = hash;
            next();
          });
        });
      },
    
      /**
       * Validates the password against constraints, but only if the user does
       * not exist, or the provided password is not the user's existing password
       * hash (safeguards against the record.save() bug)
       * @param {Object} values The values to update or insert
       * @param {Object|null} criteria The criteria to match the record(s) to
       *   update, or null if creating a new record
       * @param {Function} next The callback to invoke when done, with optional error
       */
      beforeValidate: function (values, criteria, next) {
        if (values.password === undefined) return next();
        if (!criteria) { // create
          return validatePassword(values.password, next);
        } else { // update
          // Look up user to see if values.password is actually just the existing hash
          User.findOne(criteria).exec(function (err, user) {
            if (err) return next(err);
            if (!user) return next(new Error('User to update does not seem to exist!'));
    
            if (user.password === values.password) return next();
    
            return validatePassword(values.password, next);
        }
      }
    };
    
    /**
     * Returns a hash with embedded salt given a string
     * @param {string} password The string to hash
     * @param {Function} next The callback to invoke with null or hash error and the hash
     */
    function hashPassword (password, next) {
      require('bcrypt').hash(password, 10, next);
    }
    
    /**
     * Validates a password against the constraints
     * @param {string} password The password to validate
     * @param {Function} next The callback to invoke with null or the validation error
     */
    function validatePassword (password, next) {
      if (password.length < 5 || password.length > 20)
        return next(new Error('Password should be 5-20 characters.'));
      next(null);
    }
    
    feature (please submit proposal) 
    opened by mmiller42 17
  • createEach: use async.map instead of async.eachSeries to improve performance

    createEach: use async.map instead of async.eachSeries to improve performance

    In #795, the async.each was replaced by async.eachSeries to ensure order of creation and make tests pass (for community adapters?), this however introduces a performance penalty which in my opinion and others is not worth:

    @tjwebb in https://github.com/balderdashy/sails-postgresql/issues/128#issuecomment-68575680

    .eachSeries will slow things down, though, since each create will then be done sequentially. Should the order really matter, here?

    @kevinburkeshyp in https://github.com/balderdashy/sails-postgresql/issues/128#issuecomment-95970705:

    would async.map help?

    @devinivy in https://github.com/balderdashy/waterline-adapter-tests/pull/27#issuecomment-96682857:

    I also would like to see Async#map being used as @dmarcelino mentioned.

    Pros and cons

    Using async.map instead of async.eachSeries will ensure .create([]) returns its results in order (issues balderdashy/sails-postgresql#128 and balderdashy/waterline-adapter-tests#27) without limiting performance. For situations where creation order is sensitive users can still chain independent create() commands in an async.eachSeries calls.

    Tests

    Lastly, regarding breaking tests, me and @devinivy have been fixing them in the waterline-adapter-tests (examples: balderdashy/waterline-adapter-tests#43, balderdashy/waterline-adapter-tests#52). I think it's best to fix the tests than to restrain waterline performance.

    cc: @imevs, @particlebanana, @devinivy, @tjwebb, @brandonsimpson, @kevinburkeshyp, @atiertant

    opened by dmarcelino 15
  • Added ability to specify what to populate on save()

    Added ability to specify what to populate on save()

    I noticed that every time I called .save() on my models with large association lists, I was waiting seconds for it to finish. In fact, as the association list grew (i.e. posts for a user in a social network setting), performance degraded rapidly. This small feature addition allows an optional options parameter to be passed to .save(), so the new function header is:

    model.save(cb, options);
    

    This will allow for more options to be passed to the function in the future, if necessary. Specific to this pull request is the addition of the populate key.

    The value can be an array of objects that contain details about the association you want to populate:

    // This will only populate the given associations 
    var pOpts = [
        {
            key: 'followers',
            query: {
                name: 'Mike',
                limit: 5
            }
        },
        {
            key: 'stream'
        }
    ];
    
    model.save(cb, { populate: pOpts });
    

    Or the value can be a boolean, where true will populate all associations and false will populate none:

    // This will not populate any associations
    var pOpts = false;
    model.save(cb, { populate: pOpts });
    

    The default value is true so existing code will not be affected by this change. If someone gets to writing the tests before I do, that would be fantastic (I am not familiar with this testing platform and it may take me some time to get to it). Let me know if anything should be changed!

    Thanks, Nate Kibler

    feature (please submit proposal) 
    opened by nkibler7 15
  • handel model meta attribute

    handel model meta attribute

    meta attribute is used for sails-postgresql adapter for setting table schemaName (like client.t_order. "client" is the schemaName and "t_order" is the table name).

    opened by medchkir 4
  • Run hooks with Model instance as this

    Run hooks with Model instance as this

    Implemented option to call hooks 'beforeUpdate', 'afterUpdate', 'beforeCreate', 'afterCreate', 'beforeDestroy', 'afterDestroy', with Model instance and make this point to model instead of a global scope.

    This allows to implement common logic in single place (e.g. config/models.js in Sails).

    opened by sivo1981 1
  • PATCH: Fix for when a through table has multiple associations

    PATCH: Fix for when a through table has multiple associations

    When a through table has multiple associations behavior was unpredictable because waterline actually created the mapping the with the first model that was not the child relationship.

    This fix provides an easy solution.

    opened by bieblebrox 0
  • [patch] Allow populates to use select/omit for singular associations

    [patch] Allow populates to use select/omit for singular associations

    Currently the populates clause is allowed for plural ("collection") associations but disallowed for singular ("model") associations.

    This patch allows only a select or an omit for singular associations.

    opened by danielsharvey 1
  • Fix for selecting specific fields in population for one-to-one relationship

    Fix for selecting specific fields in population for one-to-one relationship

    Fix for selecting specific fields in population for one-to-one relationship

    If there is a population for a one-to-one relationship, we should accept only "select" and "omit" attributes.

    opened by TahaBoulehmi 5
Releases(v0.11.6)
  • v0.11.6(Nov 12, 2016)

  • v0.11.4(Oct 5, 2016)

  • v0.12.2(Jun 8, 2016)

    • [BUG] Fix issues with compatibility in alter auto-migrations. This was causing corrupted data depending on the permutation of adapter version and Waterline version. This should be fixed in the SQL adapters that support the new select query modifier.
    • [ENHANCEMENT] Updated dependencies to remove warning messages when installing.
    Source code(tar.gz)
    Source code(zip)
  • v0.12.1(Mar 19, 2016)

  • v0.11.2(Mar 19, 2016)

  • v0.12.0(Mar 18, 2016)

    Finally adds support for projections! :rocket: :star2: :metal:

    You now have support for using .select() in both top level and association queries. Yeah it took until 2016 to get it added but we wanted to age it so it taste better.

    User.find()
    .select(['name', 'age'])
    .populate('pets', { select: ['breed', 'name'] })
    .exec(function(err, users) {});
    

    The other big change is the ability to pass arbitrary data down to custom adapters. You have a few ways to do this:

    First if you need to define custom values on an attribute for use with migrations for example you can add a meta key to an individual attribute and the values will be passed through when the schema is registered.

    attributes: {
      name: {
        type: 'string',
        meta: {
          size: 256
        }
    }
    

    The other option is to pass meta values directly to a custom adapter function. Some examples are shown in #1325.

    For a full roundup of changes view the updated Changelog.

    Source code(tar.gz)
    Source code(zip)
  • v0.11.1(Mar 16, 2016)

  • v0.11.0(Feb 5, 2016)

    • Removed the second argument from .save() commands that returns the newly updated data that has been re-populated. This should increase performance and limit memory.
    • Errors coming from .save() now return actual Error objects that have been extended from WLError.
    • Fixes issue with dynamic finders not understanding custom columnName attributes.
    • Auto timestamps column names are now overridable.
    • Add support for an array of values to be passed into populate. ex .populate(['foo', 'bar']).
    • Ensures that createdAt and updatedAt are always the exact same on create.
    • Fixed issue with booleans not being cast correctly for validations.
    • Fixed bug where dates as primary keys would fail serialization.
    • Update support and patch some bugs in Many-To-Many through associations.

    See the Changelog for more details.

    Source code(tar.gz)
    Source code(zip)
  • 0.9.11(Dec 20, 2013)

    • Fixes issue with attribute being removed when columnName is the same as the attribute. Thanks @cjsmith
    • Adds a .paginate method to the deferred query object. See #187 Thanks @m3talsmith
    • Adds a size schema attribute. See #194 Thanks @arielyang
    • Updated Readme to include documentation on sorts. Thanks @TheFuzzy
    • Fixed error handing with promises on Query objects. See #191 Thanks @leedm777
    • Allows validations to be functions. See #161 Thanks @ragulka
    • Updates minimum Anchor version to 0.9.7
    Source code(tar.gz)
    Source code(zip)
  • 0.9.10(Nov 21, 2013)

  • 0.9.9(Nov 6, 2013)

  • 0.9.8(Oct 30, 2013)

  • 0.9.7(Oct 29, 2013)

    • Fixes issue with custom defined primaryKeys and shorthand findOne queries
    • Fixes issue with validations on text types
    • Fixes issue with keys being removed in toJSON when columnName is the same as the attribute name
    • Adds in a .validate() method to validate model values but not create or update

    Thanks to: @Thomasdezeeuw @sjmcdowall @tanertopal @ragulka

    Source code(tar.gz)
    Source code(zip)
  • 0.9.6(Sep 29, 2013)

  • 0.9.5(Sep 27, 2013)

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server & SQLite

Prisma Quickstart • Website • Docs • Examples • Blog • Slack • Twitter • Prisma 1 What is Prisma? Prisma is a next-generation ORM that consists of the

Prisma 28k Jan 2, 2023
Azure Data Studio is a data management tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

Azure Data Studio is a data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.

Microsoft 7k Dec 31, 2022
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

TypeORM is an ORM that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms and can be used

null 30.1k Jan 3, 2023
Adapter based JavaScript ORM for Node.js and the browser

firenze.js A database agnostic adapter-based object relational mapper (ORM) targetting node.js and the browser. Visit http://firenze.js.org for docume

Fahad Heylaal 130 Jul 14, 2022
TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite databases.

TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, PostgreSQL and SQLite datab

MikroORM 5.4k Dec 31, 2022
Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

Database manager for MySQL, PostgreSQL, SQL Server, MongoDB, SQLite and others. Runs under Windows, Linux, Mac or as web application

DbGate 2k Dec 30, 2022
An easy-to-use multi SQL dialect ORM tool for Node.js

Sequelize Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server. It features solid transaction s

Sequelize 27.3k Jan 4, 2023
An SQL-friendly ORM for Node.js

Objection.js Objection.js is an ORM for Node.js that aims to stay out of your way and make it as easy as possible to use the full power of SQL and the

Vincit 6.9k Jan 5, 2023
Converts a MSSQL Result set into a markdown table, directly to stdout

mssql-result-to-md-table Tired of formating all the results of a SQL Server query into a markdown table? Well, well, well your problems are gone! Just

Deividy Metheler 2 Feb 12, 2022
A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js

bookshelf.js Bookshelf is a JavaScript ORM for Node.js, built on the Knex SQL query builder. It features both Promise-based and traditional callback i

Bookshelf.js 6.3k Jan 2, 2023
A Node.js ORM for MySQL, SQLite, PostgreSQL, MongoDB, GitHub and serverless service like Deta, InspireCloud, CloudBase, LeanCloud.

Dittorm A Node.js ORM for MySQL, SQLite, PostgreSQL, MongoDB, GitHub and serverless service like Deta, InspireCloud, CloudBase, LeanCloud. Installatio

Waline 21 Dec 25, 2022
Postgres SQL RCE.js

Postgres-SQLi-RCE.js PostgreSQL Large Objects and UDF (User Defined Functions) RCE exploit re-written in javascript, for easy chaining with XSS Methdo

Amit 1 Jan 20, 2022
Connect to private Google Cloud SQL instance through Cloud SQL Auth Proxy running in Kubernetes.

⛅ google-cloud-sql A CLI app which establishes a connection to a private Google Cloud SQL instance and port-forwards it to a local machine. Connection

Dinko Osrecki 10 Oct 16, 2022
A typesafe database ORM that exposes the full power of handwritten sql statements to the developer.

TORM A typesafe database ORM that exposes the full power of handwritten sql statements to the developer. import { torm, z } from 'https://deno.land/x/

Andrew Kaiser 15 Dec 22, 2022
This is a demo sample of linking NODEJS via ORM and MYSQL

Demons(Demo of Nodejs with SQL) This is a demo sample of linking NODEJS with ORM and MYSQL Connecting Node to SQL is a hard task and not much help is

Shivam Sourav Jha 3 Apr 14, 2022
Microsoft SQL Server client for Node.js

node-mssql Microsoft SQL Server client for Node.js Supported TDS drivers: Tedious (pure JavaScript - Windows/macOS/Linux, default) Microsoft / Contrib

null 2.1k Jan 4, 2023
A typescript data mapping tool. To support mutual transforming between domain model and orm entity.

ts-data-mapper A typescript mapping tool supports mutual transforming between domain model and orm entity. In most case, domain model is not fully com

zed 8 Mar 26, 2022
The Blog system developed by nest.js based on node.js and the database orm used typeorm, the development language used TypeScript

考拉的 Nest 实战学习系列 readme 中有很多要说的,今天刚开源还没来及更新,晚些慢慢写,其实本人最近半年多没怎么写后端代码,主要在做低代码和中台么内容,操作的也不是原生数据库而是元数据Meta,文中的原生数据库操作也当作复习下,数据库的操作为了同时适合前端和Node开发小伙伴,所以并不是很

程序员成长指北 148 Dec 22, 2022
Run SPARQL/SQL queries directly on Virtuoso database with connection pool support.

?? virtuoso-connector Package that allows you to create a direct connection to the Virtuoso database and run queries on it. Connection can be used to

Tomáš Dvořák 6 Nov 15, 2022