What is SQON (SurrealQL Object Notation)?
mainSQON is a family of data representation formats used by SurrealDB to encode its rich value system. It provides three main capabilities:
- Value classes: Specialized classes for types that have no direct JavaScript equivalent, such as
RecordId,Table,DateTime, andDecimal. - Codecs: Serializers and deserializers (
CborCodecandJsonCodec) that allow converting between JavaScript value instances and wire formats without losing type information. - Utilities: Helper functions for comparing (
equals), converting (jsonify), and escaping (escapeIdent,toSurqlString) SurrealQL values.
Note: The full surrealdb SDK re-exports everything from @surrealdb/sqon.