Registry / database / ydb-sdk-lite

ydb-sdk-lite

JSON →
library2.1.0jsnpmunverified

ydb-sdk-lite v2.1.0 is a lightweight alternative to the official YDB Node.js SDK, optimized for low require time (~100ms vs 300ms) and small size (~5MB vs 40MB). Developed by Vitaliy Potapov, it supports DDL queries, automatic parameter type inference, and is designed for serverless environments. It currently only supports primitive types. The package ships TypeScript definitions and is released as needed.

npm install ydb-sdk-lite
INSTALL
IMPORT
SIG · YDB-SDK-LITE
Y
ydb-sdk-lite
databasejavascriptv2.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

Ydb
import { Ydb } from 'ydb-sdk-lite'
import Ydb from 'ydb-sdk-lite'
Ydb is a named export, not default.
Ydb
const { Ydb } = require('ydb-sdk-lite')
const Ydb = require('ydb-sdk-lite')
CommonJS destructuring required for named export.
Ydb
import type { Ydb } from 'ydb-sdk-lite'
Type import for TypeScript when only type is needed.

Creates a Ydb client, runs a parameterized query and a DDL statement.

import { Ydb } from 'ydb-sdk-lite'; const ydb = new Ydb({ dbName: 'your-database', iamToken: process.env.YDB_TOKEN ?? '', tablePathPrefix: 'your/path' }); // Execute a simple query const [users] = await ydb.executeDataQuery('SELECT * FROM users'); console.log(users); // Execute with parameters const query = ` DECLARE $userId AS Int32; SELECT * FROM users WHERE userId = $userId; `; const [user] = await ydb.executeDataQuery(query, { $userId: 42 }); console.log(user); // Execute DDL await ydb.executeYql('DROP TABLE IF EXISTS users');
Debug
Known issues
gotchaOnly primitive types are supported (Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Double, String, Utf8, Bool, Date, Datetime, Timestamp). Complex types like Optional, List, Dict, Struct, Tuple are not supported.
fix
Use only columns with primitive types or fall back to official ydb-sdk for complex types.
affects: >=0.0.0
gotchaexecuteDataQuery only works for DML queries (SELECT, INSERT, UPDATE, DELETE). DDL or other YQL statements must use executeYql.
fix
Use executeYql for DDL queries like CREATE TABLE, DROP TABLE, etc.
affects: >=0.0.0
gotchaThe package is lightweight and intended for serverless use. It may not handle all edge cases or large datasets as efficiently as the official SDK.
fix
If you need full YDB feature set, use the official ydb-sdk package.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Class constructor Ydb cannot be invoked without 'new'
Importing Ydb incorrectly: using a default import instead of named import, then trying to call it as a function without new.
fix
Use const { Ydb } = require('ydb-sdk-lite') or import { Ydb } from 'ydb-sdk-lite' and then new Ydb(...).
Error: Unsupported type: Optional<...>
Query uses a complex type not supported by ydb-sdk-lite.
fix
Only use primitive types; avoid Optional, List, Dict, etc., or switch to official ydb-sdk.
Cannot find module 'ydb-sdk-lite'
Package not installed or typo in package name.
fix
Run npm install ydb-sdk-lite and ensure import path is correct.
Upgrade
Version history
2.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
28 hits · last 30 days
node
24
OpenAI (training)
1
Resources
ydb-sdk-lite — npm install ydb-sdk-lite · libregistry