Skip to content

Version Release#74

Merged
fox1t merged 1 commit into
mainfrom
changeset-release/main
Nov 7, 2025
Merged

Version Release#74
fox1t merged 1 commit into
mainfrom
changeset-release/main

Conversation

@matteovivona

@matteovivona matteovivona commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

valkeyrie@0.8.0

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 Multi-instance concurrency issues with atomic operations #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.

@coveralls

coveralls commented Nov 4, 2025

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 19066578026

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.279%

Totals Coverage Status
Change from base Build 19066572986: 0.0%
Covered Lines: 1696
Relevant Lines: 1759

💛 - Coveralls

@github-actions github-actions Bot force-pushed the changeset-release/main branch 11 times, most recently from 22848da to db790a7 Compare November 6, 2025 17:46
@github-actions github-actions Bot force-pushed the changeset-release/main branch from db790a7 to a96f127 Compare November 6, 2025 17:49
@fox1t fox1t added the automerge label Nov 6, 2025
@fox1t fox1t merged commit 7c754d7 into main Nov 7, 2025
7 checks passed
@fox1t fox1t deleted the changeset-release/main branch November 7, 2025 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-instance concurrency issues with atomic operations

3 participants