I wrote an ORM for Node.js called node-data-mapper; it is available here: https://www.npmjs.com/package/node-data-mapper . This is an ORM for Node.js that uses the data-mapper template. When reading and writing to the database, the developer uses plain old JavaScript objects. The relationships between the tables are not rigidly defined, which makes the join very flexible - in my opinion, in any case - albeit somewhat detailed. The actual data matching algorithm is fast and short, and the complexity is linear (the conversion from the table data of the database into a normalized JavaScript object is performed in one cycle).
I also did my best to make it pretty error resistant. There is 100% coverage of the code, and although I know that it does not prove the absence of defects, I tried to check as carefully as possible.
I modeled the interface very weakly after Doctrine 1. (I used LINQ, Doctrine 1 and 2, and Hibernate quite widely, and of those ORMs, I like the interface for Doctrine 1. node-data-mapper is not a Doctrine JavaScript port by any means, and the interface is essentially differs.) The request interface returns promises using deferred .
I modeled conditions (e.g. WHERE and ON clauses) after MongoDB conditions. We hope that this makes several intuitive conditions, providing the ability to make multiple queries (in particular, complex SELECT queries that can be filtered safely in different ways). Conditions are treated as a domain-specific language and are lexed, analyzed, and compiled.
In any case, the module is what I use in my personal projects, but I would like to receive feedback from other developers in the community! I tried to provide many examples to quickly and quickly launch people. Currently, the module only supports MySQL, but I am working on adding support for MSSQL.
avejidah
source share