Registry / database / lambdaorm

lambdaorm

JSON →
library2.3.15jsnpmunverified

λORM is a TypeScript ORM for Node.js that enables distributed queries across multiple database engines (MySQL, MariaDB, SQLite, PostgreSQL, Oracle, SQL Server, MongoDB). Version 2.3.15 supports lambda expression-based queries using a domain model, allowing data retrieval and modification from different databases in a single query. Released under MIT license, with active development and semantic versioning. Key differentiators: support for distributed queries, CQRS pattern via configuration, and multiple consumption modes (library, CLI, REST API).

database
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM only; CommonJS require() is not supported.

import { createClient } from 'lambdaorm';

You must call createClient() to get an executable instance; direct import of execute does not exist.

const { execute } = await orm.createClient({...});

Named export for query definition classes is 'Query', not 'q'.

import { Query } from 'lambdaorm';

TypeScript types are exported; use type-only imports for types to avoid bundling runtime code.

import type { ClientOptions } from 'lambdaorm';

Use dynamic import() for CommonJS projects; require() will fail with ESM-only packages.

const orm = await import('lambdaorm');

Creates a client with an in-memory SQLite database, defines a domain model, and runs a distributed query using lambda expressions.

import { createClient } from 'lambdaorm'; const orm = await createClient({ domain: [{ name: 'Products', fields: { name: 'string', price: 'number', category: { name: 'string' }, supplier: { name: 'string', country: 'string' }, inStock: 'number' } }], connections: [ { name: 'mydb', dialect: 'sqlite', connection: { database: ':memory:' } } ] }); // Run a sample query const query = (country: string) => Products .map(p => ({ category: p.category.name, largestPrice: max(p.price) })) .filter(p => (p.price > 5 && p.supplier.country == country) || (p.inStock < 3)) .having(p => max(p.price) > 50) .sort(p => desc(p.largestPrice)); const result = await orm.execute(query, { country: 'ARG' }); console.log(result); await orm.end();
Debug
Known footguns
gotchacreateClient() returns a Promise; you must await it before using orm.execute()
breakingIn version 2.x, the query syntax changed from string-based to lambda-expression-based; string queries are no longer supported.
gotchaThe domain model must be explicitly defined in the client options; automatic schema discovery is not supported.
deprecatedThe 'orm' object from createClient() has a deprecated method 'disconnect()'; use 'end()' instead.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
3
ahrefsbot
2
Resources