SDK v0.1.0

RayforceDB SDK

Full-featured JavaScript SDK with zero-copy ArrayBuffer views for high-performance data operations

Loading WASM module...
RayforceDB REPL — Rayfall Language
Initializing RayforceDB WASM...

Try these examples

Zero-Copy Vectors

Create vectors with direct TypedArray access - no data copying!

// Create I64 vector
const vec = rf.vector(Types.I64, [1, 2, 3, 4, 5]);

// Direct TypedArray view
const view = vec.typedArray; // BigInt64Array
view[0] = 100n; // Mutate in-place!

Create Tables

Build tables from JavaScript objects with automatic type inference.

const table = rf.table({
  id: [1, 2, 3],
  name: ['Alice', 'Bob', 'Carol'],
  score: [95.5, 87.3, 92.1]
});

console.log(table.toRows());

Query Builder

Build and execute queries with a fluent API.

const result = table
  .select('name', 'score')
  .where(rf.col('score').gt(90))
  .execute();

Performance Test

Benchmark vector operations with 1 million elements.

// Create 1M element vector
const big = rf.vector(Types.F64, 1000000);
const view = big.typedArray;

// Fill via TypedArray (fast!)
for (let i = 0; i < view.length; i++) {
  view[i] = Math.random();
}

Type Conversion

Convert between JavaScript and Rayforce types seamlessly.

// JS array → Rayforce vector
const vec = rf.vector(Types.F64, [1.5, 2.5, 3.5]);

// Rayforce → JS array
const arr = vec.toJS();  // [1.5, 2.5, 3.5]

// Table → JS objects
const rows = table.toRows();

Aggregations

Built-in aggregation functions for data analysis.

const data = rf.eval('(til 100)');

rf.eval('(sum data)')   // 4950
rf.eval('(avg data)')   // 49.5
rf.eval('(min data)')   // 0
rf.eval('(max data)')   // 99

Interactive Table Demo

Create and manipulate tables with the SDK.

Click "Create Sample Table" to begin