package granary

  1. Overview
  2. Docs
Pure-OCaml SQL engine

Install

dune-project
 Dependency

Authors

Maintainers

Sources

0.0.3.tar.gz
sha256=8b18780ea373be48301d9f333925860a2f9110fc0ac28684295118d72b65a67e
sha512=25ca3c9c5e2b528704a542502e0f37dc33ba003f65622d969b8c2b800778585f8ef0cf89b36e6679832e3993e8303aecddfc662742baf7044d6afe4a796b8f11

doc/granary.mirage_block/Granary_mirage_block/Mirage_backend/Make/index.html

Module Mirage_backend.MakeSource

Parameters

module B : Mirage_block.S

Signature

Sourcetype t

Adapter state: wraps B.t with page-granularity access.

Sourceval connect : ?page_size:int -> B.t -> t Lwt.t

connect ?page_size dev reads get_info from dev to determine sector size and capacity, then creates an adapter with logical n_pages = 0. page_size defaults to 4096 (#95). Raises Failure if page_size is not a multiple of the device's sector_size.

Sourceval n_pages : t -> int64
Sourceval page_size : t -> int

This adapter's page size in bytes (#95).

Sourceval read_page : t -> page_id:int64 -> Cstruct.t -> (unit, string) result Lwt.t
Sourceval write_page : t -> page_id:int64 -> Cstruct.t -> (unit, string) result Lwt.t
Sourceval sync : t -> unit -> (unit, string) result Lwt.t
Sourceval resize : t -> n_pages:int64 -> (unit, string) result Lwt.t

resize t ~n_pages validates n_pages <= capacity and updates the logical count. The physical device is not modified.

Sourceval close : t -> unit Lwt.t