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

Module Granary_columnar.ColSource

Typed column arrays backed by Bigarray.

Each column is stored as a contiguous typed array — Int64 and Real columns use Bigarray for cache-friendly sequential scan; Text columns use dictionary encoding; Blob columns use OCaml bytes arrays.

Sourcetype t
Sourceval pp : Format.formatter -> t -> unit

pp fmt col pretty-prints the column variant and row count.

Sourceval create : Row.ty -> int -> t

create ty cap creates an empty column with the given type and initial capacity.

Sourceval length : t -> int

length col returns the number of rows in the column.

Sourceval dict_size : t -> int

dict_size col returns the number of entries in the dictionary for a Text column, or 0 for non-text column types.

Sourceval append_value : t -> Row.value -> t

append_value col v returns a new column with v appended.

Sourceval get_value : t -> int -> Row.value

get_value col idx returns the value at position idx.

Sourceval append_batch : t -> Row.value array -> t

append_batch col rows returns a new column with all rows appended.

Sourceval of_values : Row.column list -> Row.t array -> t array

of_values schema rows transposes a row-major array into column-major typed arrays, one per schema column.

Sourceval encode : t -> bytes

encode col serializes the column to a portable byte string.

Sourceval decode : bytes -> int -> t * int

decode buf off deserializes a column from buf starting at offset off, returning the column and the next offset. Raises Failure on corrupt or unknown data.