Info structure refactor (#3886)

Co-authored-by: Micha de Vries <micha@devrie.sh>
This commit is contained in:
Raphael Darley 2024-04-17 16:27:55 +02:00 committed by GitHub
parent 53ad2c5366
commit 4c8c9f6c8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
143 changed files with 502 additions and 375 deletions

8
Cargo.lock generated
View file

@ -4702,9 +4702,9 @@ checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0"
[[package]] [[package]]
name = "revision" name = "revision"
version = "0.5.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87eb86913082f8976b06d07a59f17df9120e6f38b882cf3fc5a45b4499e224b6" checksum = "588784c1d9453cfd2ce1b7aff06c903513677cf0e63779a0a3085ee8a44f5b17"
dependencies = [ dependencies = [
"bincode", "bincode",
"chrono", "chrono",
@ -4720,9 +4720,9 @@ dependencies = [
[[package]] [[package]]
name = "revision-derive" name = "revision-derive"
version = "0.5.0" version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf996fc5f61f1dbec35799b5c00c6dda12e8862e8cb782ed24e10d0292e60ed3" checksum = "854ff0b6794d4e0aab5e4486870941caefe9f258e63cad2f21b49a6302377c85"
dependencies = [ dependencies = [
"darling", "darling",
"proc-macro-error", "proc-macro-error",

View file

@ -23,7 +23,13 @@ jwks = ["surrealdb/jwks"]
performance-profiler = ["dep:pprof"] performance-profiler = ["dep:pprof"]
[workspace] [workspace]
members = ["core", "lib", "lib/examples/actix", "lib/examples/axum", "lib/examples/rocket"] members = [
"core",
"lib",
"lib/examples/actix",
"lib/examples/axum",
"lib/examples/rocket",
]
[profile.release] [profile.release]
lto = true lto = true
@ -70,7 +76,14 @@ reqwest = { version = "0.11.22", default-features = false, features = [
"blocking", "blocking",
"gzip", "gzip",
] } ] }
revision = "0.5.0" revision = { version = "0.7.0", features = [
"chrono",
"geo",
"roaring",
"regex",
"rust_decimal",
"uuid",
] }
rmpv = "1.0.1" rmpv = "1.0.1"
rustyline = { version = "12.0.0", features = ["derive"] } rustyline = { version = "12.0.0", features = ["derive"] }
semver = "1.0.20" semver = "1.0.20"

View file

@ -121,7 +121,7 @@ reqwest = { version = "0.11.22", default-features = false, features = [
"stream", "stream",
"multipart", "multipart",
], optional = true } ], optional = true }
revision = "0.5.0" revision = { version = "0.7.0", features = ["chrono", "geo", "roaring", "regex", "rust_decimal", "uuid"] }
roaring = { version = "0.10.2", features = ["serde"] } roaring = { version = "0.10.2", features = ["serde"] }
rocksdb = { version = "0.21.0", features = ["lz4", "snappy"], optional = true } rocksdb = { version = "0.21.0", features = ["lz4", "snappy"], optional = true }
rust_decimal = { version = "1.33.1", features = ["maths", "serde-str"] } rust_decimal = { version = "1.33.1", features = ["maths", "serde-str"] }

View file

@ -13,8 +13,8 @@ use std::collections::{BTreeMap, HashMap};
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
// Mutation is a single mutation to a table. // Mutation is a single mutation to a table.
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 2)] #[revisioned(revision = 2)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[non_exhaustive] #[non_exhaustive]
pub enum TableMutation { pub enum TableMutation {
// Although the Value is supposed to contain a field "id" of Thing, // Although the Value is supposed to contain a field "id" of Thing,
@ -42,8 +42,8 @@ impl From<DefineTableStatement> for Value {
} }
} }
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[non_exhaustive] #[non_exhaustive]
pub struct TableMutations(pub String, pub Vec<TableMutation>); pub struct TableMutations(pub String, pub Vec<TableMutation>);
@ -53,8 +53,8 @@ impl TableMutations {
} }
} }
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[non_exhaustive] #[non_exhaustive]
pub struct DatabaseMutation(pub Vec<TableMutations>); pub struct DatabaseMutation(pub Vec<TableMutations>);
@ -71,8 +71,8 @@ impl Default for DatabaseMutation {
} }
// Change is a set of mutations made to a table at the specific timestamp. // Change is a set of mutations made to a table at the specific timestamp.
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[non_exhaustive] #[non_exhaustive]
pub struct ChangeSet(pub [u8; 10], pub DatabaseMutation); pub struct ChangeSet(pub [u8; 10], pub DatabaseMutation);

View file

@ -8,8 +8,8 @@ use std::ops::{Add, Sub};
// NOTE: This is not a statement, but as per layering, keeping it here till we // NOTE: This is not a statement, but as per layering, keeping it here till we
// have a better structure. // have a better structure.
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize, PartialOrd, Hash, Store)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize, PartialOrd, Hash, Store)]
#[non_exhaustive] #[non_exhaustive]
pub struct ClusterMembership { pub struct ClusterMembership {
pub name: String, pub name: String,
@ -20,10 +20,10 @@ pub struct ClusterMembership {
// This struct is meant to represent a timestamp that can be used to partially order // This struct is meant to represent a timestamp that can be used to partially order
// events in a cluster. It should be derived from a timestamp oracle, such as the // events in a cluster. It should be derived from a timestamp oracle, such as the
// one available in TiKV via the client `TimestampExt` implementation. // one available in TiKV via the client `TimestampExt` implementation.
#[revisioned(revision = 1)]
#[derive( #[derive(
Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize, Ord, PartialOrd, Hash, Store, Default, Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize, Ord, PartialOrd, Hash, Store, Default,
)] )]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Timestamp { pub struct Timestamp {
pub value: u64, pub value: u64,
@ -39,8 +39,8 @@ impl From<u64> for Timestamp {
// This struct is to be used only when storing keys as the macro currently // This struct is to be used only when storing keys as the macro currently
// conflicts when you have Store and Key derive macros. // conflicts when you have Store and Key derive macros.
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize, PartialOrd, Hash, Key)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize, PartialOrd, Hash, Key)]
#[non_exhaustive] #[non_exhaustive]
pub struct KeyTimestamp { pub struct KeyTimestamp {
pub value: u64, pub value: u64,

View file

@ -3,9 +3,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Debug, Display}; use std::fmt::{self, Debug, Display};
#[revisioned(revision = 1)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "UPPERCASE")] #[serde(rename_all = "UPPERCASE")]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Action { pub enum Action {
Create, Create,
@ -23,8 +23,8 @@ impl Display for Action {
} }
} }
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[non_exhaustive] #[non_exhaustive]
pub struct Notification { pub struct Notification {
/// The id of the LIVE query to which this notification belongs /// The id of the LIVE query to which this notification belongs

View file

@ -42,9 +42,9 @@ impl Response {
} }
} }
#[revisioned(revision = 1)]
#[derive(Debug, Serialize, Deserialize)] #[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "UPPERCASE")] #[serde(rename_all = "UPPERCASE")]
#[revisioned(revision = 1)]
#[doc(hidden)] #[doc(hidden)]
#[non_exhaustive] #[non_exhaustive]
pub enum Status { pub enum Status {
@ -73,8 +73,8 @@ impl Serialize for Response {
} }
} }
#[derive(Debug, Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Debug, Serialize, Deserialize)]
#[doc(hidden)] #[doc(hidden)]
#[non_exhaustive] #[non_exhaustive]
pub struct QueryMethodResponse { pub struct QueryMethodResponse {

View file

@ -5,9 +5,9 @@ use serde::{Deserialize, Serialize};
use super::{is_allowed, Action, Actor, Error, Level, Resource, Role}; use super::{is_allowed, Action, Actor, Error, Level, Resource, Role};
/// Specifies the current authentication for the datastore execution context. /// Specifies the current authentication for the datastore execution context.
#[revisioned(revision = 1)]
#[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)] #[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Auth { pub struct Auth {
actor: Actor, actor: Actor,

View file

@ -13,9 +13,9 @@ use crate::sql::statements::{DefineTokenStatement, DefineUserStatement};
// //
// User // User
// //
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Actor { pub struct Actor {
res: Resource, res: Resource,

View file

@ -7,9 +7,9 @@ use std::{
use cedar_policy::{Entity, EntityTypeName, EntityUid, RestrictedExpression}; use cedar_policy::{Entity, EntityTypeName, EntityUid, RestrictedExpression};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[revisioned(revision = 1)]
#[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Deserialize, Serialize, Hash)] #[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Deserialize, Serialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Level { pub enum Level {
#[default] #[default]

View file

@ -9,9 +9,9 @@ use super::Level;
use cedar_policy::{Entity, EntityId, EntityTypeName, EntityUid, RestrictedExpression}; use cedar_policy::{Entity, EntityId, EntityTypeName, EntityUid, RestrictedExpression};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[revisioned(revision = 1)]
#[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)] #[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum ResourceKind { pub enum ResourceKind {
#[default] #[default]
@ -79,9 +79,9 @@ impl ResourceKind {
} }
} }
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Hash, Serialize, Deserialize)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Resource(String, ResourceKind, Level); pub struct Resource(String, ResourceKind, Level);

View file

@ -6,9 +6,9 @@ use serde::{Deserialize, Serialize};
use std::str::FromStr; use std::str::FromStr;
// In the future, we will allow for custom roles. For now, provide predefined roles. // In the future, we will allow for custom roles. For now, provide predefined roles.
#[revisioned(revision = 1)]
#[derive(Hash, Clone, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)] #[derive(Hash, Clone, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Role { pub enum Role {
#[default] #[default]

View file

@ -149,8 +149,8 @@ impl DocIds {
} }
} }
#[derive(Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Serialize, Deserialize)]
struct State { struct State {
btree: BState, btree: BState,
available_ids: Option<RoaringTreemap>, available_ids: Option<RoaringTreemap>,
@ -175,8 +175,8 @@ impl VersionedSerdeState for State {
} }
} }
#[derive(Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Serialize, Deserialize)]
struct State1 { struct State1 {
btree: BState1, btree: BState1,
available_ids: Option<RoaringTreemap>, available_ids: Option<RoaringTreemap>,
@ -195,8 +195,8 @@ impl From<State1> for State {
impl VersionedSerdeState for State1 {} impl VersionedSerdeState for State1 {}
#[derive(Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Serialize, Deserialize)]
struct State1skip { struct State1skip {
btree: BState1skip, btree: BState1skip,
available_ids: Option<RoaringTreemap>, available_ids: Option<RoaringTreemap>,

View file

@ -86,8 +86,8 @@ impl From<FtStatistics> for Value {
} }
} }
#[derive(Default, Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Default, Serialize, Deserialize)]
struct State { struct State {
total_docs_lengths: u128, total_docs_lengths: u128,
doc_count: u64, doc_count: u64,

View file

@ -133,16 +133,16 @@ impl Terms {
} }
} }
#[derive(Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Serialize, Deserialize)]
struct State { struct State {
btree: BState, btree: BState,
available_ids: Option<RoaringTreemap>, available_ids: Option<RoaringTreemap>,
next_term_id: TermId, next_term_id: TermId,
} }
#[derive(Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Serialize, Deserialize)]
struct State1 { struct State1 {
btree: BState1, btree: BState1,
available_ids: Option<RoaringTreemap>, available_ids: Option<RoaringTreemap>,
@ -151,8 +151,8 @@ struct State1 {
impl VersionedSerdeState for State1 {} impl VersionedSerdeState for State1 {}
#[derive(Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Serialize, Deserialize)]
struct State1skip { struct State1skip {
btree: BState1skip, btree: BState1skip,
available_ids: Option<RoaringTreemap>, available_ids: Option<RoaringTreemap>,

View file

@ -28,8 +28,8 @@ where
bk: PhantomData<BK>, bk: PhantomData<BK>,
} }
#[derive(Clone, Serialize, Deserialize)]
#[revisioned(revision = 2)] #[revisioned(revision = 2)]
#[derive(Clone, Serialize, Deserialize)]
#[non_exhaustive] #[non_exhaustive]
pub struct BState { pub struct BState {
minimum_degree: u32, minimum_degree: u32,
@ -57,16 +57,16 @@ impl VersionedSerdeState for BState {
} }
} }
#[derive(Clone, Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Serialize, Deserialize)]
pub(in crate::idx) struct BState1 { pub(in crate::idx) struct BState1 {
minimum_degree: u32, minimum_degree: u32,
root: Option<NodeId>, root: Option<NodeId>,
next_node_id: NodeId, next_node_id: NodeId,
} }
#[derive(Clone, Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Serialize, Deserialize)]
pub(in crate::idx) struct BState1skip { pub(in crate::idx) struct BState1skip {
minimum_degree: u32, minimum_degree: u32,
root: Option<NodeId>, root: Option<NodeId>,

View file

@ -1550,8 +1550,8 @@ impl From<MtStatistics> for Value {
} }
} }
#[derive(Clone, Serialize, Deserialize)]
#[revisioned(revision = 2)] #[revisioned(revision = 2)]
#[derive(Clone, Serialize, Deserialize)]
#[non_exhaustive] #[non_exhaustive]
pub struct MState { pub struct MState {
capacity: u16, capacity: u16,

View file

@ -9,8 +9,8 @@ use std::ops::Mul;
use std::sync::Arc; use std::sync::Arc;
/// In the context of a Symmetric MTree index, the term object refers to a vector, representing the indexed item. /// In the context of a Symmetric MTree index, the term object refers to a vector, representing the indexed item.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[non_exhaustive] #[non_exhaustive]
pub enum Vector { pub enum Vector {
F64(Vec<f64>), F64(Vec<f64>),

View file

@ -8,8 +8,8 @@ use serde::Serialize;
/// The data returned by the database /// The data returned by the database
// The variants here should be in exactly the same order as `crate::engine::remote::ws::Data` // The variants here should be in exactly the same order as `crate::engine::remote::ws::Data`
// In future, they will possibly be merged to avoid having to keep them in sync. // In future, they will possibly be merged to avoid having to keep them in sync.
#[derive(Debug, Serialize)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Debug, Serialize)]
#[non_exhaustive] #[non_exhaustive]
pub enum Data { pub enum Data {
/// Generally methods return a `sql::Value` /// Generally methods return a `sql::Value`

View file

@ -4,9 +4,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 1)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Algorithm { pub enum Algorithm {
EdDSA, EdDSA,

View file

@ -16,9 +16,9 @@ use std::ops::DerefMut;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Array"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Array";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Array")] #[serde(rename = "$surrealdb::private::sql::Array")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Array(pub Vec<Value>); pub struct Array(pub Vec<Value>);

View file

@ -4,9 +4,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Base { pub enum Base {
Root, Root,

View file

@ -18,9 +18,9 @@ use std::ops::Deref;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Block"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Block";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Block")] #[serde(rename = "$surrealdb::private::sql::Block")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Block(pub Vec<Entry>); pub struct Block(pub Vec<Entry>);
@ -172,8 +172,9 @@ impl InfoStructure for Block {
self.to_string().into() self.to_string().into()
} }
} }
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Entry { pub enum Entry {

View file

@ -7,8 +7,8 @@ use serde::{
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
use std::ops::Deref; use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Bytes(pub(crate) Vec<u8>); pub struct Bytes(pub(crate) Vec<u8>);

View file

@ -11,9 +11,9 @@ use std::fmt;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Cast"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Cast";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Cast")] #[serde(rename = "$surrealdb::private::sql::Cast")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Cast(pub Kind, pub Value); pub struct Cast(pub Kind, pub Value);

View file

@ -2,9 +2,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 1)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
/// ChangeFeedInclude statements are an appendix /// ChangeFeedInclude statements are an appendix
#[non_exhaustive] #[non_exhaustive]
pub enum ChangeFeedInclude { pub enum ChangeFeedInclude {

View file

@ -7,8 +7,8 @@ use std::fmt::{self, Display, Formatter};
use std::str; use std::str;
use std::time; use std::time;
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 2)] #[revisioned(revision = 2)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[non_exhaustive] #[non_exhaustive]
pub struct ChangeFeed { pub struct ChangeFeed {
pub expiry: time::Duration, pub expiry: time::Duration,

View file

@ -5,8 +5,8 @@ use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use std::ops::Deref; use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Cond(pub Value); pub struct Cond(pub Value);

View file

@ -13,9 +13,9 @@ use std::fmt;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Constant"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Constant";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[serde(rename = "$surrealdb::private::sql::Constant")] #[serde(rename = "$surrealdb::private::sql::Constant")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Constant { pub enum Constant {

View file

@ -9,8 +9,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Data { pub enum Data {

View file

@ -14,9 +14,9 @@ use super::escape::quote_str;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Datetime"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Datetime";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Datetime")] #[serde(rename = "$surrealdb::private::sql::Datetime")]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Datetime(pub DateTime<Utc>); pub struct Datetime(pub DateTime<Utc>);

View file

@ -2,8 +2,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Dir { pub enum Dir {

View file

@ -20,9 +20,9 @@ pub(crate) static NANOSECONDS_PER_MICROSECOND: u32 = 1000;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Duration"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Duration";
#[revisioned(revision = 1)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Duration")] #[serde(rename = "$surrealdb::private::sql::Duration")]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Duration(pub time::Duration); pub struct Duration(pub time::Duration);

View file

@ -7,10 +7,10 @@ use std::fmt;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Edges"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Edges";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Edges")] #[serde(rename = "$surrealdb::private::sql::Edges")]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Edges { pub struct Edges {
pub dir: Dir, pub dir: Dir,

View file

@ -2,8 +2,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Explain(pub bool); pub struct Explain(pub bool);

View file

@ -13,9 +13,9 @@ use std::str;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Expression"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Expression";
/// Binary expressions. /// Binary expressions.
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Expression")] #[serde(rename = "$surrealdb::private::sql::Expression")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Expression { pub enum Expression {

View file

@ -7,8 +7,8 @@ use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
use std::ops::Deref; use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Fetchs(pub Vec<Fetch>); pub struct Fetchs(pub Vec<Fetch>);
@ -39,8 +39,9 @@ impl InfoStructure for Fetchs {
Value::Array(self.0.into_iter().map(|f| f.0.structure()).collect()) Value::Array(self.0.into_iter().map(|f| f.0.structure()).collect())
} }
} }
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Fetch(pub Idiom); pub struct Fetch(pub Idiom);

View file

@ -11,8 +11,8 @@ use std::borrow::Cow;
use std::fmt::{self, Display, Formatter, Write}; use std::fmt::{self, Display, Formatter, Write};
use std::ops::Deref; use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Fields(pub Vec<Field>, pub bool); pub struct Fields(pub Vec<Field>, pub bool);
@ -242,8 +242,8 @@ impl Fields {
} }
} }
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Field { pub enum Field {

View file

@ -4,9 +4,9 @@ use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use std::fmt::Display; use std::fmt::Display;
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Filter { pub enum Filter {
Ascii, Ascii,

View file

@ -20,9 +20,9 @@ use super::Kind;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Function"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Function";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Function")] #[serde(rename = "$surrealdb::private::sql::Function")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Function { pub enum Function {

View file

@ -10,9 +10,9 @@ use std::fmt;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Future"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Future";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Future")] #[serde(rename = "$surrealdb::private::sql::Future")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Future(pub Block); pub struct Future(pub Block);

View file

@ -15,10 +15,10 @@ use std::{fmt, hash};
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Geometry"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Geometry";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(rename = "$surrealdb::private::sql::Geometry")] #[serde(rename = "$surrealdb::private::sql::Geometry")]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Geometry { pub enum Geometry {
Point(Point<f64>), Point(Point<f64>),

View file

@ -12,8 +12,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Formatter, Write}; use std::fmt::{self, Display, Formatter, Write};
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Graph { pub struct Graph {

View file

@ -5,8 +5,8 @@ use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
use std::ops::Deref; use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Groups(pub Vec<Group>); pub struct Groups(pub Vec<Group>);
@ -36,8 +36,8 @@ impl Display for Groups {
} }
} }
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Group(pub Idiom); pub struct Group(pub Idiom);

View file

@ -11,8 +11,8 @@ use std::collections::BTreeMap;
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
use ulid::Ulid; use ulid::Ulid;
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Gen { pub enum Gen {
@ -21,8 +21,8 @@ pub enum Gen {
Uuid, Uuid,
} }
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Id { pub enum Id {

View file

@ -6,8 +6,8 @@ use std::fmt::{self, Display, Formatter};
use std::ops::Deref; use std::ops::Deref;
use std::str; use std::str;
#[derive(Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Ident(#[serde(with = "no_nul_bytes")] pub String); pub struct Ident(#[serde(with = "no_nul_bytes")] pub String);

View file

@ -18,8 +18,8 @@ use std::str;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Idiom"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Idiom";
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Idioms(pub Vec<Idiom>); pub struct Idioms(pub Vec<Idiom>);
@ -45,9 +45,9 @@ impl Display for Idioms {
} }
} }
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Idiom")] #[serde(rename = "$surrealdb::private::sql::Idiom")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Idiom(pub Vec<Part>); pub struct Idiom(pub Vec<Part>);

View file

@ -12,9 +12,9 @@ use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Index { pub enum Index {
/// (Basic) non unique /// (Basic) non unique
@ -28,9 +28,9 @@ pub enum Index {
MTree(MTreeParams), MTree(MTreeParams),
} }
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct SearchParams { pub struct SearchParams {
pub az: Ident, pub az: Ident,
@ -50,9 +50,9 @@ pub struct SearchParams {
pub terms_cache: u32, pub terms_cache: u32,
} }
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct MTreeParams { pub struct MTreeParams {
pub dimension: u16, pub dimension: u16,
@ -86,9 +86,9 @@ impl MTreeParams {
} }
} }
#[revisioned(revision = 1)]
#[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Distance1 { pub enum Distance1 {
#[default] #[default]
@ -99,9 +99,9 @@ pub enum Distance1 {
Minkowski(Number), Minkowski(Number),
} }
#[revisioned(revision = 1)]
#[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Distance { pub enum Distance {
Chebyshev, Chebyshev,
@ -145,9 +145,9 @@ impl Display for Distance {
} }
} }
#[revisioned(revision = 1)]
#[derive(Clone, Copy, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Copy, Default, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum VectorType { pub enum VectorType {
#[default] #[default]

View file

@ -4,9 +4,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Kind { pub enum Kind {
Any, Any,

View file

@ -3,9 +3,9 @@ use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use std::fmt::Display; use std::fmt::Display;
#[revisioned(revision = 1)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Copy, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Language { pub enum Language {
Arabic, Arabic,

View file

@ -8,8 +8,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Limit(pub Value); pub struct Limit(pub Value);

View file

@ -44,9 +44,9 @@ impl Iterator for IntoIter {
} }
} }
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Mock")] #[serde(rename = "$surrealdb::private::sql::Mock")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Mock { pub enum Mock {

View file

@ -26,9 +26,9 @@ use std::collections::HashMap;
#[cfg(feature = "ml")] #[cfg(feature = "ml")]
const ARGUMENTS: &str = "The model expects 1 argument. The argument can be either a number, an object, or an array of numbers."; const ARGUMENTS: &str = "The model expects 1 argument. The argument can be either a number, an object, or an array of numbers.";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Model { pub struct Model {
pub name: String, pub name: String,

View file

@ -13,9 +13,9 @@ use std::ops::{self, Add, Div, Mul, Neg, Rem, Sub};
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Number"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Number";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename = "$surrealdb::private::sql::Number")] #[serde(rename = "$surrealdb::private::sql::Number")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Number { pub enum Number {

View file

@ -18,9 +18,9 @@ use std::ops::DerefMut;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Object"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Object";
/// Invariant: Keys never contain NUL bytes. /// Invariant: Keys never contain NUL bytes.
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Object")] #[serde(rename = "$surrealdb::private::sql::Object")]
#[revisioned(revision = 1)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Object(#[serde(with = "no_nul_bytes_in_keys")] pub BTreeMap<String, Value>); pub struct Object(#[serde(with = "no_nul_bytes_in_keys")] pub BTreeMap<String, Value>);

View file

@ -3,10 +3,10 @@ use crate::sql::value::Value;
use revision::revisioned; use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(tag = "op")] #[serde(tag = "op")]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Operation { pub enum Operation {
Add { Add {

View file

@ -6,8 +6,8 @@ use std::fmt;
use std::fmt::Write; use std::fmt::Write;
/// Binary operators. /// Binary operators.
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Operator { pub enum Operator {

View file

@ -7,8 +7,8 @@ use std::cmp::Ordering;
use std::fmt; use std::fmt;
use std::ops::Deref; use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Orders(pub Vec<Order>); pub struct Orders(pub Vec<Order>);
@ -61,8 +61,8 @@ impl fmt::Display for Orders {
} }
} }
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Order { pub struct Order {

View file

@ -3,8 +3,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Output { pub enum Output {

View file

@ -12,10 +12,10 @@ use std::{fmt, ops::Deref, str};
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Param"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Param";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Param")] #[serde(rename = "$surrealdb::private::sql::Param")]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Param(pub Ident); pub struct Param(pub Ident);

View file

@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use std::str; use std::str;
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum Part { pub enum Part {

View file

@ -9,9 +9,9 @@ use std::fmt::Write;
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
use std::str; use std::str;
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Permissions { pub struct Permissions {
pub select: Permission, pub select: Permission,
@ -132,9 +132,9 @@ impl PermissionKind {
} }
} }
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Permission { pub enum Permission {
None, None,

View file

@ -11,8 +11,8 @@ use std::str;
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Query"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Query";
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[serde(rename = "$surrealdb::private::sql::Query")] #[serde(rename = "$surrealdb::private::sql::Query")]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]

View file

@ -21,10 +21,10 @@ use std::str::FromStr;
const ID: &str = "id"; const ID: &str = "id";
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Range"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Range";
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Hash)]
#[serde(rename = "$surrealdb::private::sql::Range")] #[serde(rename = "$surrealdb::private::sql::Range")]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Range { pub struct Range {
#[serde(with = "no_nul_bytes")] #[serde(with = "no_nul_bytes")]

View file

@ -15,8 +15,8 @@ use std::{env, str};
pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Regex"; pub(crate) const TOKEN: &str = "$surrealdb::private::sql::Regex";
#[derive(Clone)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone)]
#[non_exhaustive] #[non_exhaustive]
pub struct Regex(pub regex::Regex); pub struct Regex(pub regex::Regex);

View file

@ -3,9 +3,9 @@ use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use std::hash::{Hash, Hasher}; use std::hash::{Hash, Hasher};
#[revisioned(revision = 1)]
#[derive(Clone, Debug, PartialOrd, Serialize, Deserialize)] #[derive(Clone, Debug, PartialOrd, Serialize, Deserialize)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Scoring { pub enum Scoring {
Bm { Bm {

View file

@ -5,8 +5,8 @@ use std::fmt::{self, Display, Formatter};
use std::ops::Deref; use std::ops::Deref;
use std::str; use std::str;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Script(#[serde(with = "no_nul_bytes")] pub String); pub struct Script(#[serde(with = "no_nul_bytes")] pub String);

View file

@ -5,8 +5,8 @@ use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Formatter}; use std::fmt::{self, Display, Formatter};
use std::ops::Deref; use std::ops::Deref;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Splits(pub Vec<Split>); pub struct Splits(pub Vec<Split>);
@ -32,8 +32,8 @@ impl fmt::Display for Splits {
} }
} }
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Split(pub Idiom); pub struct Split(pub Idiom);

View file

@ -8,8 +8,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct Start(pub Value); pub struct Start(pub Value);

View file

@ -22,9 +22,9 @@ use std::{
time::Duration, time::Duration,
}; };
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct Statements(pub Vec<Statement>); pub struct Statements(pub Vec<Statement>);
@ -52,9 +52,9 @@ impl Display for Statements {
} }
} }
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum Statement { pub enum Statement {
Value(Value), Value(Value),

View file

@ -18,8 +18,8 @@ use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub enum AnalyzeStatement { pub enum AnalyzeStatement {

View file

@ -3,8 +3,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct BeginStatement; pub struct BeginStatement;

View file

@ -8,8 +8,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct BreakStatement; pub struct BreakStatement;

View file

@ -3,8 +3,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct CancelStatement; pub struct CancelStatement;

View file

@ -3,9 +3,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct CommitStatement; pub struct CommitStatement;

View file

@ -8,8 +8,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct ContinueStatement; pub struct ContinueStatement;

View file

@ -8,8 +8,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 2)] #[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct CreateStatement { pub struct CreateStatement {

View file

@ -10,9 +10,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 3)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 3)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineAnalyzerStatement { pub struct DefineAnalyzerStatement {
pub name: Ident, pub name: Ident,

View file

@ -10,9 +10,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineDatabaseStatement { pub struct DefineDatabaseStatement {
pub id: Option<u32>, pub id: Option<u32>,

View file

@ -10,9 +10,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineEventStatement { pub struct DefineEventStatement {
pub name: Ident, pub name: Ident,

View file

@ -15,9 +15,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Write}; use std::fmt::{self, Display, Write};
#[revisioned(revision = 3)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 3)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineFieldStatement { pub struct DefineFieldStatement {
pub name: Idiom, pub name: Idiom,

View file

@ -13,9 +13,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Write}; use std::fmt::{self, Display, Write};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineFunctionStatement { pub struct DefineFunctionStatement {
pub name: Ident, pub name: Ident,

View file

@ -13,9 +13,9 @@ use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
use std::sync::Arc; use std::sync::Arc;
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineIndexStatement { pub struct DefineIndexStatement {
pub name: Ident, pub name: Ident,

View file

@ -37,9 +37,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum DefineStatement { pub enum DefineStatement {
Namespace(DefineNamespaceStatement), Namespace(DefineNamespaceStatement),

View file

@ -13,9 +13,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Write}; use std::fmt::{self, Write};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineModelStatement { pub struct DefineModelStatement {
pub hash: String, pub hash: String,

View file

@ -10,9 +10,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineNamespaceStatement { pub struct DefineNamespaceStatement {
pub id: Option<u32>, pub id: Option<u32>,

View file

@ -11,9 +11,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Write}; use std::fmt::{self, Display, Write};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineParamStatement { pub struct DefineParamStatement {
pub name: Ident, pub name: Ident,

View file

@ -12,9 +12,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineScopeStatement { pub struct DefineScopeStatement {
pub name: Ident, pub name: Ident,

View file

@ -20,9 +20,9 @@ use std::fmt::{self, Display, Write};
use super::DefineFieldStatement; use super::DefineFieldStatement;
#[revisioned(revision = 3)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 3)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineTableStatement { pub struct DefineTableStatement {
pub id: Option<u32>, pub id: Option<u32>,

View file

@ -10,9 +10,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineTokenStatement { pub struct DefineTokenStatement {
pub name: Ident, pub name: Ident,

View file

@ -15,9 +15,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DefineUserStatement { pub struct DefineUserStatement {
pub name: Ident, pub name: Ident,
@ -206,7 +206,7 @@ impl InfoStructure for DefineUserStatement {
let Self { let Self {
name, name,
base, base,
code, hash,
roles, roles,
comment, comment,
.. ..
@ -217,7 +217,7 @@ impl InfoStructure for DefineUserStatement {
acc.insert("base".to_string(), base.structure()); acc.insert("base".to_string(), base.structure());
acc.insert("code".to_string(), code.into()); acc.insert("passhash".to_string(), hash.into());
acc.insert( acc.insert(
"roles".to_string(), "roles".to_string(),

View file

@ -8,9 +8,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct DeleteStatement { pub struct DeleteStatement {
#[revision(start = 2)] #[revision(start = 2)]

View file

@ -9,9 +9,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display}; use std::fmt::{self, Display};
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct ForeachStatement { pub struct ForeachStatement {
pub param: Param, pub param: Param,

View file

@ -9,8 +9,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::{self, Display, Write}; use std::fmt::{self, Display, Write};
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct IfelseStatement { pub struct IfelseStatement {

View file

@ -10,22 +10,64 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub enum InfoStatement { pub enum InfoStatement {
#[revision(end = 2, convert_fn = "root_migrate")]
Root, Root,
#[revision(start = 2)]
Root(bool),
#[revision(end = 2, convert_fn = "ns_migrate")]
Ns, Ns,
#[revision(start = 2)]
Ns(bool),
#[revision(end = 2, convert_fn = "db_migrate")]
Db, Db,
#[revision(start = 2)]
Db(bool),
#[revision(end = 2, convert_fn = "sc_migrate")]
Sc(Ident), Sc(Ident),
#[revision(start = 2)]
Sc(Ident, bool),
#[revision(end = 2, convert_fn = "tb_migrate")]
Tb(Ident), Tb(Ident),
#[revision(start = 2)]
Tb(Ident, bool),
#[revision(end = 2, convert_fn = "user_migrate")]
User(Ident, Option<Base>), User(Ident, Option<Base>),
RootStructure, #[revision(start = 2)]
NsStructure, User(Ident, Option<Base>, bool),
DbStructure, }
ScStructure(Ident),
TbStructure(Ident), impl InfoStatement {
fn root_migrate(_revision: u16, _: ()) -> Result<Self, revision::Error> {
Ok(Self::Root(false))
}
fn ns_migrate(_revision: u16, _: ()) -> Result<Self, revision::Error> {
Ok(Self::Ns(false))
}
fn db_migrate(_revision: u16, _: ()) -> Result<Self, revision::Error> {
Ok(Self::Db(false))
}
fn sc_migrate(_revision: u16, i: (Ident,)) -> Result<Self, revision::Error> {
Ok(Self::Sc(i.0, false))
}
fn tb_migrate(_revision: u16, n: (Ident,)) -> Result<Self, revision::Error> {
Ok(Self::Tb(n.0, false))
}
fn user_migrate(
_revision: u16,
(i, b): (Ident, Option<Base>),
) -> Result<Self, revision::Error> {
Ok(Self::User(i, b, false))
}
} }
impl InfoStatement { impl InfoStatement {
@ -39,7 +81,7 @@ impl InfoStatement {
) -> Result<Value, Error> { ) -> Result<Value, Error> {
// Allowed to run? // Allowed to run?
match self { match self {
InfoStatement::Root => { InfoStatement::Root(false) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Root)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Root)?;
// Claim transaction // Claim transaction
@ -61,7 +103,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::Ns => { InfoStatement::Ns(false) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Ns)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Ns)?;
// Claim transaction // Claim transaction
@ -89,7 +131,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::Db => { InfoStatement::Db(false) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?;
// Claim transaction // Claim transaction
@ -147,7 +189,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::Sc(sc) => { InfoStatement::Sc(sc, false) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?;
// Claim transaction // Claim transaction
@ -163,7 +205,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::Tb(tb) => { InfoStatement::Tb(tb, false) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?;
// Claim transaction // Claim transaction
@ -203,7 +245,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::User(user, base) => { InfoStatement::User(user, base, false) => {
let base = base.clone().unwrap_or(opt.selected_base()?); let base = base.clone().unwrap_or(opt.selected_base()?);
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Actor, &base)?; opt.is_allowed(Action::View, ResourceKind::Actor, &base)?;
@ -220,7 +262,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res.to_string()).ok() Value::from(res.to_string()).ok()
} }
InfoStatement::RootStructure => { InfoStatement::Root(true) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Root)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Root)?;
// Claim transaction // Claim transaction
@ -234,7 +276,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::NsStructure => { InfoStatement::Ns(true) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Ns)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Ns)?;
// Claim transaction // Claim transaction
@ -250,7 +292,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::DbStructure => { InfoStatement::Db(true) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?;
// Claim transaction // Claim transaction
@ -294,7 +336,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::ScStructure(sc) => { InfoStatement::Sc(sc, true) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?;
// Claim transaction // Claim transaction
@ -309,7 +351,7 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::TbStructure(tb) => { InfoStatement::Tb(tb, true) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?; opt.is_allowed(Action::View, ResourceKind::Any, &Base::Db)?;
// Claim transaction // Claim transaction
@ -344,6 +386,23 @@ impl InfoStatement {
// Ok all good // Ok all good
Value::from(res).ok() Value::from(res).ok()
} }
InfoStatement::User(user, base, true) => {
let base = base.clone().unwrap_or(opt.selected_base()?);
// Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Actor, &base)?;
// Claim transaction
let mut run = txn.lock().await;
// Process the user
let res = match base {
Base::Root => run.get_root_user(user).await?,
Base::Ns => run.get_ns_user(opt.ns(), user).await?,
Base::Db => run.get_db_user(opt.ns(), opt.db(), user).await?,
_ => return Err(Error::InvalidLevel(base.to_string())),
};
// Ok all good
Ok(res.structure())
}
} }
} }
} }
@ -351,20 +410,24 @@ impl InfoStatement {
impl fmt::Display for InfoStatement { impl fmt::Display for InfoStatement {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self { match self {
Self::Root => f.write_str("INFO FOR ROOT"), Self::Root(false) => f.write_str("INFO FOR ROOT"),
Self::RootStructure => f.write_str("INFO FOR ROOT STRUCTURE"), Self::Root(true) => f.write_str("INFO FOR ROOT STRUCTURE"),
Self::Ns => f.write_str("INFO FOR NAMESPACE"), Self::Ns(false) => f.write_str("INFO FOR NAMESPACE"),
Self::NsStructure => f.write_str("INFO FOR NAMESPACE STRUCTURE"), Self::Ns(true) => f.write_str("INFO FOR NAMESPACE STRUCTURE"),
Self::Db => f.write_str("INFO FOR DATABASE"), Self::Db(false) => f.write_str("INFO FOR DATABASE"),
Self::DbStructure => f.write_str("INFO FOR DATABASE STRUCTURE"), Self::Db(true) => f.write_str("INFO FOR DATABASE STRUCTURE"),
Self::Sc(ref s) => write!(f, "INFO FOR SCOPE {s}"), Self::Sc(ref s, false) => write!(f, "INFO FOR SCOPE {s}"),
Self::ScStructure(ref s) => write!(f, "INFO FOR SCOPE {s} STRUCTURE"), Self::Sc(ref s, true) => write!(f, "INFO FOR SCOPE {s} STRUCTURE"),
Self::Tb(ref t) => write!(f, "INFO FOR TABLE {t}"), Self::Tb(ref t, false) => write!(f, "INFO FOR TABLE {t}"),
Self::TbStructure(ref t) => write!(f, "INFO FOR TABLE {t} STRUCTURE"), Self::Tb(ref t, true) => write!(f, "INFO FOR TABLE {t} STRUCTURE"),
Self::User(ref u, ref b) => match b { Self::User(ref u, ref b, false) => match b {
Some(ref b) => write!(f, "INFO FOR USER {u} ON {b}"), Some(ref b) => write!(f, "INFO FOR USER {u} ON {b}"),
None => write!(f, "INFO FOR USER {u}"), None => write!(f, "INFO FOR USER {u}"),
}, },
Self::User(ref u, ref b, true) => match b {
Some(ref b) => write!(f, "INFO FOR USER {u} ON {b} STRUCTURE"),
None => write!(f, "INFO FOR USER {u} STRUCTURE"),
},
} }
} }
} }
@ -376,16 +439,15 @@ pub(crate) trait InfoStructure {
} }
impl InfoStatement { impl InfoStatement {
pub(crate) fn structurize(self) -> Result<Self, ()> { pub(crate) fn structurize(self) -> Self {
let out = match self { match self {
InfoStatement::Root => InfoStatement::RootStructure, InfoStatement::Root(_) => InfoStatement::Root(true),
InfoStatement::Ns => InfoStatement::NsStructure, InfoStatement::Ns(_) => InfoStatement::Ns(true),
InfoStatement::Db => InfoStatement::DbStructure, InfoStatement::Db(_) => InfoStatement::Db(true),
InfoStatement::Sc(s) => InfoStatement::ScStructure(s), InfoStatement::Sc(s, _) => InfoStatement::Sc(s, true),
InfoStatement::Tb(t) => InfoStatement::TbStructure(t), InfoStatement::Tb(t, _) => InfoStatement::Tb(t, true),
_ => return Err(()), InfoStatement::User(u, b, _) => InfoStatement::User(u, b, true),
}; }
Ok(out)
} }
} }

View file

@ -8,9 +8,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct InsertStatement { pub struct InsertStatement {
pub into: Value, pub into: Value,

View file

@ -13,9 +13,9 @@ use crate::kvs::lq_structs::{KillEntry, TrackedResult};
use crate::sql::Uuid; use crate::sql::Uuid;
use crate::sql::Value; use crate::sql::Value;
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct KillStatement { pub struct KillStatement {
// Uuid of Live Query // Uuid of Live Query

View file

@ -13,9 +13,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 2)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 2)]
#[non_exhaustive] #[non_exhaustive]
pub struct LiveStatement { pub struct LiveStatement {
pub id: Uuid, pub id: Uuid,

View file

@ -4,9 +4,9 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)] #[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[revisioned(revision = 1)]
#[non_exhaustive] #[non_exhaustive]
pub struct OptionStatement { pub struct OptionStatement {
pub name: Ident, pub name: Ident,

View file

@ -9,8 +9,8 @@ use revision::revisioned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt; use std::fmt;
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[revisioned(revision = 1)] #[revisioned(revision = 1)]
#[derive(Clone, Debug, Default, Eq, PartialEq, PartialOrd, Serialize, Deserialize, Store, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[non_exhaustive] #[non_exhaustive]
pub struct OutputStatement { pub struct OutputStatement {

Some files were not shown because too many files have changed in this diff Show more