Registry / database / nukak-maria

nukak-maria

JSON →
library1.9.1jsnpmunverified

MariaDB adapter for nukak, a TypeScript ORM with a declarative JSON query syntax and smart type-safety. Current stable version is 1.9.1, released frequently (multiple minor versions per month). Differentiators: unified API across PostgreSQL, MySQL, MariaDB, SQLite, and MongoDB; serializable JSON queries; naming strategies (e.g., camelCase to snake_case); built-in serialization for thread safety; supports soft-delete, virtual fields, repositories, and migrations. Peer dependencies: mariadb ^3.0.2 and nukak ^1.8.1. Pure ESM package; no CJS support.

npm install nukak-maria
INSTALL
IMPORT
SIG · NUKAK-MARIA
N
nukak-maria
databasejavascriptv1.9.1
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.

MariaDbConnector
✓ import { MariaDbConnector } from 'nukak-maria'
✗ const { MariaDbConnector } = require('nukak-maria')
Package is pure ESM; CJS require() will throw. Use dynamic import or ESM setup.
closeAllConnections
✓ import { closeAllConnections } from 'nukak-maria'
✗ import { closeAllConnections } from 'nukak'
Connector-specific utilities are exported from the adapter package, not from nukak core.
MariaDbEntity
✓ import { MariaDbEntity } from 'nukak-maria'
✗ import { Entity } from 'nukak'
Use MariaDbEntity instead of generic Entity to get MariaDB-specific behavior and type inference.

Set up a MariaDB connector, define an entity with decorators, and run a query with $select, $where, and $limit.

import { MariaDbConnector, closeAllConnections } from 'nukak-maria'; import { Entity, PrimaryKey, Property, Serialized, createQuery } from 'nukak'; @Serialized() class User extends MariaDbEntity { @PrimaryKey() id!: number; @Property() name!: string; @Property() email!: string; } async function main() { const connector = new MariaDbConnector({ host: process.env.DB_HOST ?? 'localhost', user: process.env.DB_USER ?? 'root', password: process.env.DB_PASSWORD ?? '', database: process.env.DB_NAME ?? 'test', }); const query = createQuery(connector); const users = await query.findMany(User, { $select: { name: true, email: true }, $where: { email: { $endsWith: '@example.com' } }, $limit: 10, }); console.log(users); await closeAllConnections(); } main().catch(console.error);
Debug
Known issues
breakingPackage is pure ESM (ES modules) and does not support CommonJS require().
fix
Use import syntax or dynamic import(). Ensure 'type': 'module' in package.json.
affects: >=1.0.0
gotchaTypeScript decorators require 'experimentalDecorators' and 'emitDecoratorMetadata' enabled in tsconfig.json.
fix
Add "experimentalDecorators": true and "emitDecoratorMetadata": true to your tsconfig.json compilerOptions.
affects: >=1.0.0
deprecated`@Serialized()` decorator is required on entity classes for thread-safe serialization. If omitted, concurrent operations may cause race conditions.
fix
Annotate every entity class that will be persisted with @Serialized().
affects: >=1.0.0
gotchaThe `mariadb` driver must be installed separately as a peer dependency. Forgetting it will cause runtime errors when connecting.
fix
Run: npm install mariadb
affects: >=1.0.0
breakingAdapter-specific exports (e.g., MariaDbConnector, closeAllConnections) were moved to the adapter package in v1.0.0. Previously they were in the core nukak package.
fix
Import from 'nukak-maria' instead of 'nukak'.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'nukak-maria' or its corresponding type declarations.
Package not installed or tsconfig not set to node moduleResolution.
fix
Run npm install nukak-maria and ensure tsconfig.json includes 'moduleResolution': 'node' or 'node16'.
SyntaxError: Cannot use import statement outside a module
Package is ESM-only but the project is using CommonJS.
fix
Add 'type': 'module' to package.json or rename .js files to .mjs.
Property 'findMany' does not exist on type 'Query<MariaDbConnector>'. Did you mean 'find'?
Typo: correct method is 'findMany' (plural) not 'find'.
fix
Use query.findMany(...). Note: find() is not a method; use findFirst(), findMany(), or findOne().
Cannot find name 'closeAllConnections'
Imported from wrong package.
fix
import { closeAllConnections } from 'nukak-maria' instead of 'nukak'.
Upgrade
Version history
1.9.1latest on npm
Audit
Dependencies
mariadbrequiredRequired MariaDB driver for database connectivity
nukakrequiredCore ORM library providing base classes, query building, and migration system
Agent activity
14 hits · last 30 days
node
12
Resources
nukak-maria — npm install nukak-maria · libregistry