Skip to content

About

An SQLite-based Zarr store for the zarrs ecosystem

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

Repository files navigation

zarrs_sqlite

An SQLite-based Zarr store for the zarrs ecosystem, implementing the zarr-sqlite-python specification.

Usage

use std::sync::Arc;
use zarrs::storage::ReadableWritableListableStorage;
use zarrs_sqlite::{Options, RusqliteStore};

// Use new_local("path/to/file.zarrdb") for a file-backed database.
let options = Options::new_memory()
    // Allow (but do not require) creation of new database.
    .create()
    // Allow (but do not require) deleting an existing database.
    .truncate();

// Stores are opened read-only by default, unless `.create()`, `.truncate()`, or `.write()` are used.

let inner = RusqliteStore::new(&options).expect("could not open store");
// Alternatively use `TursoStore` for WAL + async.

let store: ReadableWritableListableStorage = Arc::new(inner);

Features

Backends

This crate supports multiple SQLite backends, each behind a cargo feature.

RusqliteStore

  • feature: backend-rusqlite (default)
  • crates: rusqlite + r2d2

Synchronous store which uses connection pooling and binds to libsqlite3.

TursoStore

Asynchronous store written in pure rust which uses write-ahead log journaling by default.

After you've finished writing to the store, use my_store.checkpoint().await to write the contents of the WAL to the main database file.

About

An SQLite-based Zarr store for the zarrs ecosystem

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages