Registry / database / yaso
library0.0.32jsnpmunverified

yaso (Yet Another SQL ORM) is a lightweight, opinionated ORM for PostgreSQL, currently at version 0.0.32 with an active release cadence. It provides table definitions with field-level encryption, hashing, automatic timestamps, and version counts. Key differentiators include a strongly-typed query builder that generates raw SQL, subquery support, and built-in convenience features for sensitive data. It is TypeScript-first with full type support, making it suitable for Node.js applications wanting a minimal ORM layer without heavy abstractions.

npm install yaso
INSTALL
IMPORT
SIG · YASO
Y
yaso
databasejavascriptv0.0.32
harness data pending
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.

DBTable
import { DBTable } from 'yaso'
const DBTable = require('yaso')
yaso is ESM-only; CommonJS require() will not work.
selectFrom
import { selectFrom } from 'yaso'
import { selectFrom } from 'yaso/src'
selectFrom is a named export from the main package entry.
ITableDefinition
import type { ITableDefinition } from 'yaso'
import { ITableDefinition } from 'yaso'
ITableDefinition is a TypeScript type and should be imported using `import type` to avoid runtime errors.

Shows table definition, query building with selectFrom, and parameterized WHERE clause.

import { DBTable, selectFrom, equals, prm } from 'yaso'; const tblDef = { name: 'User', dbName: 'usr', fields: [ { name: '_id', dbName: 'usr_id' }, { name: 'email', dbName: 'usr_email' }, ], }; interface IUser { _id: string; email: string; } const userTbl = new DBTable<IUser>(tblDef); const query = selectFrom(userTbl, (qry, usr) => qry.fields([usr._id, usr.email]) .where(equals(usr._id, prm('userId'))) ).toString(); console.log(query); // select usr.usr_id as "_id", usr.usr_email as "email" from usr where usr.usr_id = $[userId]
Debug
Known issues
breakingyaso v0.0.x may introduce breaking changes without major version bumps.
fix
Pin to a specific version and test upgrades.
affects: <1.0.0
deprecatedSome API names may change before stable release.
fix
Follow changelog and update imports accordingly.
affects: <1.0.0
gotchaField definitions require both `name` and `dbName`; using only `name` will cause runtime errors.
fix
Always specify `dbName` with the actual column name.
affects: *
Errors
Common errors & fixes
Cannot find module 'yaso' or its corresponding type declarations
TypeScript cannot find yaso types; possibly missing @types/yaso or version mismatch.
fix
Ensure TypeScript 4.x+ and run `npm install yaso` (types are bundled).
export 'default' (imported as 'yaso') was not found in 'yaso'
Attempting default import when only named exports exist.
fix
Use `import { DBTable, selectFrom } from 'yaso'` instead of default import.
Upgrade
Version history
0.0.32latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
28
OpenAI (training)
1
Resources
packageyaso
yaso — npm install yaso · libregistry