TypeScript SDK
The dcupl SDK is the in-memory query engine under dcupl: define typed models, load data from any source and query them in the browser or in Node.js, with relationships, indexing, facets and change events built in.
npm install @dcupl/coreyarn add @dcupl/corepnpm add @dcupl/core These docs describe @dcupl/core 2.1 and @dcupl/cli 2.0. The npm packages are published under the ISC license.
How it works
Define models
Create typed schemas with properties, relationships, and validation rules. Models define the structure of your data and how each property is parsed, validated and indexed.
dcupl.models.set({
key: 'Product',
properties: [
{ key: 'name', type: 'string' },
{ key: 'price', type: 'int' },
{ key: 'category', type: 'string' },
]
});Load data
Load data from inline arrays, fetch from APIs, or use the Loader with Console. Data is indexed automatically for fast queries.
// Inline data
dcupl.data.set(products, {
model: 'Product'
});
// Initialize and build indexes
await dcupl.init();Query instantly
Filter, sort, aggregate, and analyze your data. All queries run in memory, equality filters against inverse indexes — no server round-trips needed.
const list = dcupl.lists.create({
modelKey: 'Product'
});
// Add filters
list.catalog.query.addCondition({
attribute: 'category',
operator: 'eq',
value: 'Electronics'
});
// Get results
const items = list.catalog.query.items();Key capabilities
Data models
Typed schemas with validation rules and computed properties
Relationships
Connect models via references — products to categories, orders to users
Indexed queries
Equality filters (eq, in) use inverse indexes — no full scan, no server round-trip
Analysis functions
Facets, aggregations, groupBy, pivot tables — built-in
Real-time updates
Upsert, delete, refresh data — lists refresh and notify you on update()
TypeScript first
TypeScript types included, IntelliSense, works with any framework
Explore the SDK
The SDK docs are organized into three tracks. Start with Learn if you're new, jump to Build when you're applying dcupl to a real project, and use Reference to look up exact APIs.
Learn
Build
Analysis functions
Facets, aggregations, groupBy, pivot, and suggestions
Advanced patterns
Faceted search, master–detail, infinite scroll, realtime
Guides
TypeScript, testing, debugging, deployment, scripts, and common mistakes
Performance & caching
Tune indexing, memoization, and data loading for large datasets