Package Exports
- lambdaorm
- lambdaorm/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lambdaorm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
λORM
λORM is an ORM that allows us to perform distributed queries on different database engines.
In λORM, queries are defined using lambda expressions based on a domain model which abstracts us from the infrastructure. For example, in a query you can obtain or modify records from different entities, where some persist in MySQL, others in Postgres, and others in Mongo.
λORM allows you to define different scenarios for the same domain. For example, in one scenario, the infrastructure may consist of distributed instances across SQL Server, MongoDB, and Oracle, while in another scenario it may be a single Postgres instance. This allows the CQRS pattern to be implemented through configuration, without needing to write a single line of code. view example
In addition to being used as a Node.js library, it can be consumed from a command line interface (CLI), a REST service, or a REST service client in other programming languages.
Query Language
Example of a query where orders and their details associated with a customer are obtained:
const query = (customerId:string)=> Orders.filter(p=>p.customerId==customerId)
.include(p=>p.details)
.page(1,1)
const result = await orm.execute(query, {customerId: 'CENTC' })Schema Configuration
Through the schema, you can define entities, enumerations, indexes, unique keys, default values, constraints, mapping, sources, stages, listeners, etc. The schema can be defined in a JSON or YAML format. Conditions or actions are performed using the same expression language that is used to define queries.
Features
- Supports MySQL, MariaDB, PostgresSQL, Oracle, SqlServer, SqlJs and MongoDB.
- Schema Configuration
- Decoupling the domain model from infrastructure
- Configuration in json or yml formats
- Definition of mappings between domain and infrastructure
- Extends entities
- Environment variables
- define indices, unique keys and constraints
- Conditions and actions are based on the expression engine 3xpr
- Decoupling the domain model from infrastructure
- Query Language
- Simple query language based on javascript lambda expressions.
- Can write the expression as javascript code or as a string
- Crud clauses
- Implicit joins and group by
- Eager loading using the Include() method.
- Query expression metadata
- Repositories and custom repositories
- Transactions and distributed transactions
- Performance and Optimization
- BulkInsert
- High performance queries
- Connection pooling
- Listeners and subscribers
- TypeScript and JavaScript support
- CLI Support support
- REST API Support
- HTTP Client Support
- Node Client
- Kotlin Client (In Progress)
- Java Client (Coming Soon)
- C# Client (Coming Soon)
- Python Client (Coming Soon)
Contributing
¿Te gustaría contribuir? Lea nuestras pautas de contribución para saber más. ¡Hay muchas maneras de ayudar!
Documentation
Full documentation is available in the Wiki.
All Labs
You can access various labs at lambdaorm labs