@velocitydb/vcdb
v0.1.0
Published
Modern Node.js ORM + CLI for VelocityDB
Downloads
17
Maintainers
Readme
vcdb
Node.js client + CLI for Velocity Database.
- Website:
https://velocitydb.org - GitHub Organization:
https://github.com/velocitydb-org
Features
vcdb initcreates install files for your project.vcdb generatereadsschema.vcdband generatesvelocity/modals/*.json.- JSON-based models:
{"name":"string"}format. - Prisma-style delegates:
create,findMany,findUnique,update,delete,upsert. - Coded error system (
VCDB_E_*) with actionable hints.
Install
npm i vcdbProject Links
- Official Site:
https://velocitydb.org - GitHub Org:
https://github.com/velocitydb-org
CLI
vcdb init
vcdb generate
vcdb validateGenerated structure:
velocity/
schema.vcdb
vcdb.config.json
modals/
User.jsonSchema (Prisma-like)
datasource db {
provider = "velocity"
host = "127.0.0.1"
port = 2005
username = "admin"
password = "admin1234"
}
model User {
id String @id
name String
email String
createdAt DateTime
}Client Usage
import { createClient } from "vcdb";
const db = createClient({
host: "127.0.0.1",
port: 2005,
username: "admin",
password: "admin1234",
modelsDir: "./velocity/modals"
});
await db.$connect();
const user = await db.user.create({
data: { name: "Mert", email: "[email protected]", createdAt: new Date().toISOString() }
});
const list = await db.user.findMany({ where: { name: "Mert" }, limit: 50 });
await db.$disconnect();Error Codes
Examples:
VCDB_E_CONFIG_INVALIDVCDB_E_CONNECTION_FAILEDVCDB_E_AUTH_FAILEDVCDB_E_QUERY_FAILEDVCDB_E_MODEL_NOT_FOUNDVCDB_E_SCHEMA_PARSEVCDB_E_VALIDATION_FAILED
Each thrown VCDBError contains:
codemessagehintdetails
