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.columnar/Granary_columnar/Col_store/index.html

Module Granary_columnar.Col_storeSource

In-memory columnar store for COLUMNSTORE tables.

Rows are stored as per-column Bigarray arrays for cache-friendly scan performance. Text columns use dictionary encoding.

Sourcetype t
Sourceval create : Row.column list -> t

create columns returns an empty store with the given schema.

Sourceval nrows : t -> int

nrows store returns the number of rows currently held.

Sourceval columns : t -> Row.column list

columns store returns the schema that was passed to create.

Sourceval insert_rows : t -> Row.t array -> unit

insert_rows store batch appends batch to the store, transposing rows into typed column arrays.

Sourceval to_row_seq : t -> Row.t Seq.t

to_row_seq store streams all rows in insertion order by reading from the typed column arrays.

Sourceval encode : t -> bytes

encode store serializes the entire store (schema + data) to a byte string.

Sourceval decode : ?off:int -> Row.column list -> bytes -> t

decode ?off schema buf deserializes a store from buf starting at offset off (default 0) using the given schema. Raises Failure on corrupt or malformed data.

Sourceval dirty : t -> bool

dirty store returns true if the store has been mutated since the last call to mark_clean (i.e. has unpersisted changes).

Sourceval mark_clean : t -> unit

mark_clean store resets the dirty flag.

Sourceval mark_dirty : t -> unit

mark_dirty store sets the dirty flag.