API/Protocol
EdgeDB.Protocol.Codec
A codec knows how to work with the internal binary data from EdgeDB. The binary protocol specification for the codecs can be found in the relevant part of the EdgeDB documentation. Useful links for codec developers:
-
Guide to developing custom codecs on hex.pm or on edgedb.com.
Types
Functions
function
EdgeDB.Protocol.Codec.decode(codec, data, codec_storage)
@spec EdgeDB.Protocol.Codec.decode(t(), bitstring(), EdgeDB.Protocol.CodecStorage.t()) :: value when value: term()
Function that can decode EdgeDB binary format into an entity.
EdgeDB.Protocol.CustomCodec
Behaviour for custom scalar codecs.
See custom codecs development guide on hex.pm or on edgedb.com for more information.
EdgeDB.Protocol.CodecStorage
A storage for each codec that the connection knows how to decode.
Types
Functions
function
EdgeDB.Protocol.CodecStorage.get(storage, id)
@spec EdgeDB.Protocol.CodecStorage.get(t(), binary()) :: EdgeDB.Protocol.Codec.t() | nil
Find a codec in the storage by ID.
EdgeDB.Protocol.Enums
Definition for enumerations used in EdgeDB protocol.
Types
type
EdgeDB.Protocol.Enums.capabilities/0
@type EdgeDB.Protocol.Enums.capabilities() :: [capability()]
Query capabilities.
type
EdgeDB.Protocol.Enums.capability/0
@type EdgeDB.Protocol.Enums.capability() ::
:readonly
| :modifications
| :session_config
| :transaction
| :ddl
| :persistent_config
| :all
| :execute
| :legacy_execute
Query capabilities.
Values:
-
:readonly
- query is read-only. -
:modifications
- query is not read-only. -
:session_config
- query contains session config change. -
:transaction
- query contains start/commit/rollback of transaction or savepoint manipulation. -
:ddl
- query contains DDL. -
:persistent_config
- server or database config change. -
:all
- all possible capabilities. -
:execute
- capabilities to execute query.
type
EdgeDB.Protocol.Enums.cardinality/0
@type EdgeDB.Protocol.Enums.cardinality() :: :no_result | :at_most_one | :one | :many | :at_least_one
Cardinality of the query result.
Values:
-
:no_result
- query doesn’t return anything. -
:at_most_one
- query return an optional single elements. -
:one
- query return a single element. -
:many
- query return a set of elements. -
:at_least_one
- query return a set with at least of one elements.
type
EdgeDB.Protocol.Enums.compilation_flag/0
@type EdgeDB.Protocol.Enums.compilation_flag() ::
:inject_output_type_ids | :inject_output_type_names | :inject_output_object_ids
Compilation flags for query to extend it’s features.
Values:
-
:inject_output_type_ids
- inject__tid__
property as.__type__.id
alias into returned objects. -
:inject_output_type_names
- inject__tname__
property as.__type__.name
alias into returned objects. -
:inject_output_object_ids
- injectid
property into returned objects.
type
EdgeDB.Protocol.Enums.compilation_flags/0
@type EdgeDB.Protocol.Enums.compilation_flags() :: [compilation_flag()]
Compilation flags for query to extend it’s features.
type
EdgeDB.Protocol.Enums.output_format/0
@type EdgeDB.Protocol.Enums.output_format() :: :binary | :json | :json_elements | :none
Data output format.
Values:
-
:binary
- return data encoded in binary. -
:json
- return data as single row and single field that contains the result set as a single JSON array. -
:json_elements
- return a single JSON string per top-level set element. This can be used to iterate over a large result set efficiently. -
:none
- prevent EdgeDB from returning anything event if EdgeQL query does it.