orderkey_snapshot

    Download zip
    Author
    Version
    0.0.18
    License
    MIT
    Last updated
    6 hours ago
    Downloads
    10

    #OrderKey snapshot reader

    Native MoonBit reader for verified, portable OrderKey candidates. The full repository includes docs/QUERIES.md with query and SDK examples. Package using python scripts/package_snapshot.py from the repository root: the parent module excludes snapshot/ from the core package, so SDK packaging uses an isolated stage.

    Import WeiR-h/orderkey_snapshot and WeiR-h/orderkey. Reader::open(directory) validates and loads once. Reader::query(QuerySpec, limit~, cursor~) performs typed pagination with no further filesystem access. Page exposes rows, scanned and optional cursor. Data stays frozen for the session; new readers validate files again.

    This module depends on MoonFST (MIT), async and sha256 (Apache-2.0). It does not open MoonLSM. The core module remains standard-library-only. MIT license; reference and dependency notices are in the repository THIRD_PARTY.md. No independent user adoption is claimed.

    SnapshotError

    pub suberror SnapshotError {
    InvalidSnapshot(String)
    }

    Page

    pub(all) struct Page {
    rows : Array[Record]
    cursor : Bytes?
    scanned : Int
    }

    Reader

    pub struct Reader {
    // private fields
    }

    Immutable in-memory session. No filesystem access after open returns.

    Reader::loaded_bytes

    fn Reader::loaded_bytes(self : Reader) -> Int64

    Reader::open

    async fn Reader::open(dir : String) -> Reader

    Opens a portable candidate without requiring original input paths.

    Reader::query

    fn Reader::query(self : Reader, query :
    QuerySpec
    , limit? : Int, cursor? : Bytes?) -> Page raise

    Reader::row_count

    fn Reader::row_count(self : Reader) -> Int

    Record

    pub(all) struct Record {
    key : Bytes
    value : Bytes
    }

    Source Files