Skip to content

Releases: ducktors/valkeyrie

v0.8.4

08 Jun 10:17

Choose a tag to compare

Patch Changes

  • 8a7a48b: Add driver constructor support
  • 9a8ee9a: fix(deps): bump minimatch from 9.0.5 to 9.0.7 in the npm_and_yarn group across 1 directory

v0.8.3

28 Nov 22:41
70d6565

Choose a tag to compare

Patch Changes

  • 85a9cfc: fix: cursor pagination with deep keys and non-string types

v0.8.2

27 Nov 23:00
31a8506

Choose a tag to compare

Patch Changes

  • a0abc46: Add documentation website
  • a22d008: fix: list() prefix type inference now returns union of all matching schemas

v0.8.1

12 Nov 09:32
0393ddf

Choose a tag to compare

Patch Changes

  • 99ba459: Remove c8 in favor of native coverage
  • 8559588: Build only ESM and drop tsx
  • f92c806: chore: remove benchmarks

v0.8.0

07 Nov 08:23
7c754d7

Choose a tag to compare

Minor Changes

  • ef32a4b: feat: add from and fromAsync factory functions for database population

    This adds two new static factory methods to create and populate Valkeyrie databases from existing data sources:

    • Valkeyrie.from(iterable, options) - Create and populate a database from synchronous iterables (arrays, Sets, Maps, custom iterables)
    • Valkeyrie.fromAsync(asyncIterable, options) - Create and populate a database from async iterables (async generators, streams, async iterators)

    Key Features:

    • Flexible key extraction via property names or custom functions
    • Automatic batching (1000 items per atomic operation) for optimal performance
    • Progress tracking with optional callbacks
    • Configurable error handling (stop or continue on errors)
    • Support for all database options (TTL, custom serializers, file paths, etc.)
    • Memory efficient processing for large datasets

    Example:

    const users = [
      { id: 1, name: "Alice" },
      { id: 2, name: "Bob" },
    ];
    
    const db = await Valkeyrie.from(users, {
      prefix: ["users"],
      keyProperty: "id",
      onProgress: (processed, total) => console.log(`${processed}/${total}`),
    });

    This is especially useful for data migrations, imports, seeding databases, and creating databases from API responses or streams.

Patch Changes

  • 1893805: Complete documentation overhaul with new structure and missing feature documentation

    New Documentation Structure:

    • Split monolithic docs into focused guides and API reference
    • Created beginner-friendly getting started guide
    • Added comprehensive guides for schema validation, factory methods, serializers, and advanced patterns
    • Complete API reference with all methods and types

    Previously Missing Documentation:

    • Watch API - Complete documentation for real-time key monitoring (added in v0.5.0)
    • Type Inference - Automatic TypeScript type inference from schemas
    • Multi-instance Concurrency - Database-level versionstamp generation improvements (v0.7.2)
    • Symbol.asyncDispose - Automatic resource management support

    New Guides:

    • docs/guides/getting-started.md - Complete beginner tutorial
    • docs/guides/schema-validation.md - Type-safe operations with Zod, Valibot, ArkType
    • docs/guides/factory-methods.md - Create databases from arrays and streams
    • docs/guides/serializers.md - Choose and configure serializers
    • docs/guides/advanced-patterns.md - Watch API, atomic operations, real-world patterns

    API Reference:

    • docs/api/api-reference.md - Complete method reference
    • docs/api/types.md - TypeScript types and interfaces

    Improvements:

    • Clear navigation with docs/README.md index
    • Real-world examples throughout
    • Decision trees for choosing options
    • Migration guides from Deno.kv
    • Troubleshooting sections

    The old docs/documentation.md has been archived as docs/documentation.md.old.

  • 065368c: Implement database-level versionstamp generation for multi-instance concurrency and fix watch stream cancel bug

    Multi-Instance Concurrency (fixes #64):

    • Implement database-level sequence table for atomic versionstamp generation across multiple instances
    • Replace process-local versionstamp generation with SQLite sequence-based approach
    • Add proper transaction nesting support with inTransaction state tracking
    • Implement retry logic for versionstamp generation with exponential backoff
    • Use BEGIN IMMEDIATE TRANSACTION for exclusive database locks to ensure cross-process atomicity
    • Maintain 20-character versionstamp format (timestamp + sequence) for API compatibility

    Bug Fix:

    • Fix watch stream cancel() callback to correctly use closure-scoped controller
    • Remove incorrect controller.close() call in cancel handler (stream infrastructure handles this)

    Test Coverage:

    • Add test for concurrent versionstamp generation with multiple driver instances
    • Add test for watch controller close errors with unexpected error types
    • Add test for rollback failures in transaction retry logic
    • Update watch cancellation test to properly test the cancel path

    This prevents race conditions and lost updates when multiple Valkeyrie instances share the same SQLite database file.

v0.7.1

04 Apr 08:43
f94446e

Choose a tag to compare

Patch Changes

v0.7.0

03 Apr 15:45
d6be327

Choose a tag to compare

Minor Changes

  • 7f3312d: Add destroy and clear methods

v0.6.0

26 Mar 11:25
cbdb01e

Choose a tag to compare

Minor Changes

  • d4f4d5d: remove size limits for values

v0.5.1

25 Mar 17:31
371468e

Choose a tag to compare

Patch Changes

  • 686914a: named import for bson functions

v0.5.0

25 Mar 17:12
30a1c4e

Choose a tag to compare

Minor Changes

  • e5699d6: Implements watch method and fixes broken transactions with multiple clients