3e80aa9914
`sql::Value` is an integral part of `surrealdb`. It's the internal type used by our storage layer. Because of this, we do a lot of converting between this type and native Rust types. Currently this conversion is done through `JSON` using the `serde_json` crate because we do not have our own custom data format implementation. This works because `SQL` is a superset of `JSON`. This, however, means that this conversion is lossy and can cause surprises in some cases. For example expecting record IDs to be deserialized into a `String` instead of its corresponding Rust native type. This change implements a custom data format around `sql::Value` and introduces a `to_value` function that facilitates that conversion.
35 lines
404 B
Rust
35 lines
404 B
Rust
pub use self::value::*;
|
|
|
|
pub(super) mod serde;
|
|
|
|
#[allow(clippy::module_inception)]
|
|
mod value;
|
|
|
|
mod all;
|
|
mod array;
|
|
mod clear;
|
|
mod compare;
|
|
mod decrement;
|
|
mod def;
|
|
mod del;
|
|
mod diff;
|
|
mod each;
|
|
mod every;
|
|
mod extend;
|
|
mod fetch;
|
|
mod first;
|
|
mod flatten;
|
|
mod generate;
|
|
mod get;
|
|
mod increment;
|
|
mod last;
|
|
mod merge;
|
|
mod object;
|
|
mod patch;
|
|
mod pick;
|
|
mod put;
|
|
mod replace;
|
|
mod rid;
|
|
mod set;
|
|
mod single;
|
|
mod walk;
|