Registry / database / database.do

database.do

JSON →
library0.0.1jsnpmunverified

An AI-native data access SDK currently at version 0.0.1 that abstracts common database operations across MongoDB, PostgreSQL, and SQLite. It leverages AI to automate schema inference, query generation, and data transformation. Designed for rapid prototyping and integration with AI agents, it prioritizes simplicity over raw performance, distinguishing itself from traditional ORMs by reducing boilerplate through natural language-like commands. Released weekly with breaking changes expected before 1.0.

npm install database.do
INSTALL
IMPORT
SIG · DATABASE.DO
D
database.do
databasejavascriptv0.0.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

Database
✓ import { Database } from 'database.do'
✗ const Database = require('database.do')
ESM-only package; CommonJS require not supported. Use dynamic import if needed.
connect
✓ import { connect } from 'database.do'
✗ import database from 'database.do'; database.connect()
Named export, not default. Use connect() directly.
schema
✓ import { schema } from 'database.do'
TypeScript type export for defining database schemas; no CommonJS equivalent.
query
✓ import { query } from 'database.do'
✗ import { Database } from 'database.do'; Database.query()
query is a standalone function, not a method on Database instance.

Connects to a PostgreSQL database using environment variable for URI, runs a parameterized query, and closes the connection.

import { Database } from 'database.do'; const db = new Database({ type: 'postgres', connectionString: process.env.DATABASE_URL ?? 'postgresql://localhost:5432/mydb' }); async function main() { await db.connect(); const result = await db.query('SELECT * FROM users WHERE id = $1', [1]); console.log(result.rows); await db.close(); } main().catch(console.error);
Debug
Known issues
breakingv0.0.1 renames `createDatabase` to `Database` constructor; old import breaks
fix
Use `new Database({...})` instead of `createDatabase({...})`.
affects: <0.0.1
breakingv0.0.1 removes `mongodb` driver from default installation; needs explicit opt-in
fix
Install `mongodb` separately: `npm install mongodb`.
affects: 0.0.1
deprecated`query` method on `Database` instance is deprecated in favor of standalone `query` function
fix
Use `import { query } from 'database.do'` and pass `db` as first argument.
affects: >=0.0.1
gotchaPackage is ESM-only; cannot `require()` in CommonJS projects
fix
Switch to ESM or use dynamic `import('database.do')`.
affects: >=0.0.1
gotchaTypeScript users must set `"moduleResolution": "node16"` or `"bundler"` for correct type inference
fix
Update tsconfig.json: `"moduleResolution": "node16"`.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: Database is not a constructor
Incorrect import: using default import instead of named import
fix
Change to `import { Database } from 'database.do'`.
Cannot find module 'database.do' or its corresponding type declarations.
TypeScript not configured for ESM resolution
fix
Set `"moduleResolution": "node16"` in tsconfig.json.
UnhandledPromiseRejectionWarning: Error: No database type specified
Missing `type` field in Database constructor options
fix
Add `type: 'postgres' | 'mongodb' | 'sqlite'` to the options object.
Error: Cannot find module 'pg'
PostgreSQL driver not installed
fix
Run `npm install pg`.
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies
mongodboptionalMongoDB driver for database operations
pgoptionalPostgreSQL driver for database operations
sqlite3optionalSQLite driver for database operations
Agent activity
17 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
database.do — npm install database.do · libregistry