Skip to content

data-access

English | 日本語

Framework-independent record CRUD, resource services and database adapters. This MIT public repository is the canonical source. Runtime dependencies: none. Provider SDKs are optional peers. No React, storage or data-engine dependency.

Terminal window
npm install @alneas/data-access
import { createResourceService } from '@alneas/data-access';
import { SQLiteDataAccessAdapter } from '@alneas/data-access/sqlite';
import type { SqliteDriver } from '@alneas/data-access/sqlite';
export function records(driver: SqliteDriver) {
const adapter = new SQLiteDataAccessAdapter({ driver });
return createResourceService<{ id: string; title: string }>(adapter, 'records');
}
// const result = await records(driver).find({ title: 'Example' }, { limit: 10 });

The caller creates the database/table and supplies the driver. Node.js >=24 and Bun are supported Node consumers; SQLite/D1 and HTTP adapters can run in other compatible hosts. Oracle direct SQL requires a server runtime and its driver. Runtime support is per adapter, not a promise that all adapters run in browsers.

Import Backend / requirement
root, /types, /resource-service, /search-handlers, /cache-scope, /bignumber-adapter SDK-independent interfaces, services, search helpers, cache identities, injected decimal constructor
/sqlite Injected SqliteDriver, or createSqliteDriver with a compatible prepared-statement API
/d1 Application-supplied Cloudflare D1 binding
/supabase, /supabase-graphql Application-created @supabase/supabase-js 2.x client
/mongodb HTTP endpoint implementing this package’s Mongo API protocol; not a MongoDB wire driver
/convex Injected client and application query/mutation references; no React import
/neon Injected queryFn, or optional @neondatabase/serverless 1.x and a server-side connection string

See the usage and constraints guide before using filters or exposing an adapter through an API. Shared TypeScript interfaces do not guarantee equal backend capabilities, authorization, transactions or JSON Schema validation. JSDoc in src defines API details. The unified documentation site is ALNEAS Docs.

Graph algorithms belong to task-graph; AI common processing and proposal review to ai-core. Graph-aware task/agent dispatch and schema integration stay in data-engine. Its schema-aware Supabase integration imports this package, keeping dependencies one-way. File/object storage is independently provided by universal-storage. Private app-core maintains compatibility exports and private project metadata.

See CONTRIBUTING.md for independent verification and RELEASING.md for npm CI and initial publication order.

Oracle SQL/Duality View/ORDS/function adapters are private premium integrations. Use bun run test:containers for real PostgreSQL CRUD through NeonAdapter queryFn.

Consumer AI guidance ships in dist/ai/SKILL.md and package-context.json. Preview the package-scoped additions to your project instructions with the following command. Add --write after reviewing the preview; existing instructions are preserved.

Terminal window
node node_modules/@alneas/data-access/dist/ai/setup.mjs --project .