Liking cljdoc? Tell your friends :D

xitdb.util.conversion


*debug?*clj

source

array-list-write-cursorclj

(array-list-write-cursor wal i)

Returns a cursor to slot i in the array list. Throws if index is out of bounds.

Returns a cursor to slot i in the array list.
Throws if index is out of bounds.
sourceraw docstring

coll->ArrayListCursor!clj

(coll->ArrayListCursor! cursor coll)

Converts a Clojure collection to a XitDB ArrayList cursor. Handles nested maps and collections recursively. Returns the cursor of the created WriteArrayList.

Converts a Clojure collection to a XitDB ArrayList cursor.
Handles nested maps and collections recursively.
Returns the cursor of the created WriteArrayList.
sourceraw docstring

database-bytesclj

(database-bytes s)
(database-bytes s tag)
source

db-key-hashclj

(db-key-hash jdb v)

Returns a byte array representing the stable hash digest of (Clojure) value v. Uses the MessageDigest from the database.

Returns a byte array representing the stable hash digest of (Clojure) value `v`.
Uses the MessageDigest from the database.
sourceraw docstring

default-sorted-comparator?clj

(default-sorted-comparator? coll)

True if coll (a PersistentTreeMap or PersistentTreeSet) is ordered in a way the engine can honour with its fixed unsigned byte ordering: either Clojure's natural ordering (no custom comparator) or sorted-key/key-comparator, which is that byte ordering and is what materialize stamps onto the collections it rebuilds. Any other custom comparator is rejected.

True if `coll` (a PersistentTreeMap or PersistentTreeSet) is ordered in a way
the engine can honour with its fixed unsigned byte ordering: either Clojure's
natural ordering (no custom comparator) or `sorted-key/key-comparator`, which
*is* that byte ordering and is what `materialize` stamps onto the collections
it rebuilds. Any other custom comparator is rejected.
sourceraw docstring

false-strclj

source

fmt-tag-keywordclj

(fmt-tag-keyword v)
source

fmt-tag-valueclj

source

keynameclj

(keyname key)
source

keypath-cursorclj

(keypath-cursor cursor keypath)

Recursively goes to keypath and returns the write cursor

Recursively goes to keypath and returns the write cursor
sourceraw docstring

linked-array-list-write-cursorclj

(linked-array-list-write-cursor wlal i)
source

list->LinkedArrayListCursor!clj

(list->LinkedArrayListCursor! cursor coll)

Converts a Clojure list or seq-like collection to a XitDB LinkedArrayList cursor. Optimized for sequential access collections rather than random access ones.

Converts a Clojure list or seq-like collection to a XitDB LinkedArrayList cursor.
Optimized for sequential access collections rather than random access ones.
sourceraw docstring

map->WriteHashMapCursor!clj

(map->WriteHashMapCursor! cursor m)

Writes a Clojure map to a XitDB WriteHashMap. Returns the cursor of the created WriteHashMap.

Writes a Clojure map to a XitDB WriteHashMap.
Returns the cursor of the created WriteHashMap.
sourceraw docstring

map-write-cursorclj

(map-write-cursor whm key)

Gets a write cursor for the specified key in a WriteHashMap. Creates the key if it doesn't exist.

Gets a write cursor for the specified key in a WriteHashMap.
Creates the key if it doesn't exist.
sourceraw docstring

primitive-forclj

(primitive-for v)

Converts a Clojure primitive value to its corresponding XitDB representation. Handles strings, keywords, integers, booleans, and floats. Throws an IllegalArgumentException for unsupported types.

Converts a Clojure primitive value to its corresponding XitDB representation.
Handles strings, keywords, integers, booleans, and floats.
Throws an IllegalArgumentException for unsupported types.
sourceraw docstring

read-bytes-with-format-tagclj

(read-bytes-with-format-tag cursor)

Reads a BYTES value (as a string) at cursor and converts it to a Clojure type. Checks the formatTag at cursor to determine the type encoded in the bytes object and converts the value to the respective Clojure type (eg. keyword, boolean, instant, date). Supported types are in the global constant fmt-tag-value. If there is no format tag (or it is unknown), returns the value as a string.

Reads a `BYTES` value (as a string) at `cursor` and converts it to a Clojure type.
Checks the `formatTag` at cursor to determine the type encoded in the bytes object and
converts the value to the respective Clojure type (eg. keyword, boolean, instant, date).
Supported types are in the global constant `fmt-tag-value`.
If there is no format tag (or it is unknown), returns the value as a string.
sourceraw docstring

set->WriteCursor!clj

(set->WriteCursor! cursor s)

Writes a Clojure set s to a XitDB WriteHashSet. Returns the cursor of the created WriteHashSet.

Writes a Clojure set `s` to a XitDB WriteHashSet.
Returns the cursor of the created WriteHashSet.
sourceraw docstring

set-write-cursorclj

(set-write-cursor whs key)
source

sorted-map->WriteSortedMapCursor!clj

(sorted-map->WriteSortedMapCursor! cursor m)

Writes a Clojure sorted map m to a XitDB WriteSortedMap. Keys are encoded with the order-preserving codec; values are written recursively via v->slot!. Returns the cursor of the created WriteSortedMap.

Writes a Clojure sorted map `m` to a XitDB WriteSortedMap.
Keys are encoded with the order-preserving codec; values are written
recursively via `v->slot!`. Returns the cursor of the created WriteSortedMap.
sourceraw docstring

sorted-set->WriteSortedSetCursor!clj

(sorted-set->WriteSortedSetCursor! cursor s)

Writes a Clojure sorted set s to a XitDB WriteSortedSet. Members are encoded with the order-preserving codec. Returns the cursor of the created WriteSortedSet.

Writes a Clojure sorted set `s` to a XitDB WriteSortedSet.
Members are encoded with the order-preserving codec. Returns the cursor of the
created WriteSortedSet.
sourceraw docstring

true-strclj

source

v->slot!clj

(v->slot! cursor v)

Converts a value to a XitDB slot. Handles WriteArrayList and WriteHashMap instances directly. Recursively processes Clojure maps and collections. Falls back to primitive conversion for other types.

Converts a value to a XitDB slot.
Handles WriteArrayList and WriteHashMap instances directly.
Recursively processes Clojure maps and collections.
Falls back to primitive conversion for other types.
sourceraw docstring

write-cursor-for-keyclj

(write-cursor-for-key cursor current-key)
source

xit-tag->keywordclj

(xit-tag->keyword tag)

Converts a XitDB Tag enum to a corresponding Clojure keyword.

Converts a XitDB Tag enum to a corresponding Clojure keyword.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close