suweal/node
Types
pub type BinopNS {
BinopNS(
create: fn(Node, Operator, Node) -> Node,
equal: fn(Node, Node) -> Node,
not_equal: fn(Node, Node) -> Node,
greater_than: fn(Node, Node) -> Node,
less_than: fn(Node, Node) -> Node,
greater_than_or_equal: fn(Node, Node) -> Node,
less_than_or_equal: fn(Node, Node) -> Node,
access: fn(Node, Node) -> Node,
namespace_access: fn(Node, Node) -> Node,
inside: fn(Node, Node) -> Node,
relation_to: fn(Node, Node) -> Node,
relation_from: fn(Node, Node) -> Node,
relation_to_from: fn(Node, Node) -> Node,
indexing: fn(Node, Node) -> Node,
and: fn(Node, Node) -> Node,
or: fn(Node, Node) -> Node,
)
}
Constructors
-
BinopNS( create: fn(Node, Operator, Node) -> Node, equal: fn(Node, Node) -> Node, not_equal: fn(Node, Node) -> Node, greater_than: fn(Node, Node) -> Node, less_than: fn(Node, Node) -> Node, greater_than_or_equal: fn(Node, Node) -> Node, less_than_or_equal: fn(Node, Node) -> Node, access: fn(Node, Node) -> Node, namespace_access: fn(Node, Node) -> Node, inside: fn(Node, Node) -> Node, relation_to: fn(Node, Node) -> Node, relation_from: fn(Node, Node) -> Node, relation_to_from: fn(Node, Node) -> Node, indexing: fn(Node, Node) -> Node, and: fn(Node, Node) -> Node, or: fn(Node, Node) -> Node, )
pub type DefineAccessNS {
DefineAccessNS(
create: fn(String) -> Node,
with_strategy: fn(Node, DefineAccessStrategy) -> Node,
with_target: fn(Node, DefineAccessTarget) -> Node,
with_signin: fn(Node, Node) -> Node,
with_signup: fn(Node, Node) -> Node,
with_jwt_config: fn(Node, JWTConfiguration) -> Node,
)
}
Constructors
pub type DefineAccessStrategy {
DefineAccessIfNotExists
DefineAccessOverwrite
DefineAccessRegular
}
Constructors
-
DefineAccessIfNotExists -
DefineAccessOverwrite -
DefineAccessRegular
pub type DefineAccessTarget {
DefineAccessDatabase
DefineAccessNamespace
DefineAccessRoot
}
Constructors
-
DefineAccessDatabase -
DefineAccessNamespace -
DefineAccessRoot
pub type DefineAccessType {
DefineAccessRecord(
signup: option.Option(Node),
signin: option.Option(Node),
jwt_config: option.Option(JWTConfiguration),
)
}
Constructors
-
DefineAccessRecord( signup: option.Option(Node), signin: option.Option(Node), jwt_config: option.Option(JWTConfiguration), )
pub type DefineFieldNS {
DefineFieldNS(
create: fn(Node, String, surreal_type.SurrealType) -> Node,
with_strategy: fn(Node, DefineFieldStrategy) -> Node,
with_default: fn(Node, Node) -> Node,
with_assert: fn(Node, Node) -> Node,
add_permission: fn(Node, Permission) -> Node,
set_flexible: fn(Node, Bool) -> Node,
)
}
Constructors
pub type DefineFieldStrategy {
DefineFieldIfNotExists
DefineFieldOverwrite
DefineFieldRegular
}
Constructors
-
DefineFieldIfNotExists -
DefineFieldOverwrite -
DefineFieldRegular
pub type DefineTableStrategy {
DefineTableIfNotExists
DefineTableOverwrite
DefineTableRegular
}
Constructors
-
DefineTableIfNotExists -
DefineTableOverwrite -
DefineTableRegular
pub type Node {
DefineTable(
name: String,
strategy: DefineTableStrategy,
schema: SchemaType,
type_: TableType,
permissions: List(Permission),
as_: option.Option(Node),
)
DefineField(
name: Node,
strategy: DefineFieldStrategy,
table: String,
type_: surreal_type.SurrealType,
flexible: Bool,
default: option.Option(Node),
assert_: option.Option(Node),
permissions: List(Permission),
)
DefineIndex(
name: String,
table: String,
fields: List(String),
unique: Bool,
)
DefineAccess(
name: String,
strategy: DefineAccessStrategy,
target: DefineAccessTarget,
type_: DefineAccessType,
)
FunctionCall(node: Node, arguments: List(Node))
Self
None
All
Number(Float)
Parameter(String)
Identifier(String)
Value(surreal_ql.SurrealQL)
Object(List(#(String, Node)))
Array(List(Node))
Select(
fields: List(SelectField),
only: Bool,
table: String,
where: option.Option(Node),
order: option.Option(List(#(Node, OrderDirection))),
limit: option.Option(Node),
group_all: Bool,
)
If(
condition: Node,
then_: Node,
else_ifs: List(#(Node, Node)),
else_: Node,
)
BinaryOperator(lhs: Node, operator: Operator, rhs: Node)
WrappedNode(node: Node)
Update(
only: Bool,
target: String,
set: List(Node),
where: option.Option(Node),
)
Create(only: Bool, target: String, set: List(Node))
Relate(table: String, from: Node, to: Node, set: List(Node))
Lambda(parameters: List(String), body: Node)
Delete(only: Bool, target: Node, where: option.Option(Node))
}
Constructors
-
DefineTable( name: String, strategy: DefineTableStrategy, schema: SchemaType, type_: TableType, permissions: List(Permission), as_: option.Option(Node), )https://surrealdb.com/docs/reference/query-language/statements/define/table
-
DefineField( name: Node, strategy: DefineFieldStrategy, table: String, type_: surreal_type.SurrealType, flexible: Bool, default: option.Option(Node), assert_: option.Option(Node), permissions: List(Permission), )https://surrealdb.com/docs/reference/query-language/statements/define/field
-
DefineIndex( name: String, table: String, fields: List(String), unique: Bool, )https://surrealdb.com/docs/reference/query-language/statements/define/indexes
-
DefineAccess( name: String, strategy: DefineAccessStrategy, target: DefineAccessTarget, type_: DefineAccessType, )https://surrealdb.com/docs/reference/query-language/statements/define/access
-
-
Selfhttps://surrealdb.com/docs/learn/data-models/graph/recursive-traversals
-
Nonehttps://surrealdb.com/docs/reference/query-language/language-primitives/data-types/none-and-null
-
Allhttps://surrealdb.com/docs/learn/data-models/graph/graph-traversal
-
Number(Float)https://surrealdb.com/docs/reference/query-language/language-primitives/data-types/numbers Different from Value(surreal_ql.Float | surreal_ql.Int) as it can be coerced to both types.
-
Parameter(String)https://surrealdb.com/docs/reference/query-language/language-primitives/parameters
-
Identifier(String)Raw Identifier
-
Value(surreal_ql.SurrealQL)https://surrealdb.com/docs/reference/query-language/language-primitives/data-types/values
-
Object(List(#(String, Node)))https://surrealdb.com/docs/reference/query-language/language-primitives/data-types/objects
-
Array(List(Node))https://surrealdb.com/docs/reference/query-language/language-primitives/data-types/arrays
-
Select( fields: List(SelectField), only: Bool, table: String, where: option.Option(Node), order: option.Option(List(#(Node, OrderDirection))), limit: option.Option(Node), group_all: Bool, )https://surrealdb.com/docs/reference/query-language/statements/select
-
https://surrealdb.com/docs/reference/query-language/statements/if-else
-
https://surrealdb.com/docs/reference/query-language/language-primitives/operators
-
WrappedNode(node: Node)Node wrapped in ()
-
Update( only: Bool, target: String, set: List(Node), where: option.Option(Node), )https://surrealdb.com/docs/reference/query-language/statements/update
-
Create(only: Bool, target: String, set: List(Node))https://surrealdb.com/docs/reference/query-language/statements/create
-
https://surrealdb.com/docs/reference/query-language/statements/relate
-
Lambda(parameters: List(String), body: Node)https://surrealdb.com/docs/reference/query-language/language-primitives/data-types/closures
-
Delete(only: Bool, target: Node, where: option.Option(Node))https://surrealdb.com/docs/reference/query-language/statements/delete
pub type OperationType {
OperationCreate
OperationSelect
OperationUpdate
OperationDelete
}
Constructors
-
OperationCreate -
OperationSelect -
OperationUpdate -
OperationDelete
pub type Operator {
Equal
NotEqual
GreaterThan
LessThan
GreaterThanOrEqual
LessThanOrEqual
Access
NamespaceAccess
Inside
RelationTo
RelationFrom
RelationToFrom
Indexing
And
Or
}
Constructors
-
Equal -
NotEqual -
GreaterThan -
LessThan -
GreaterThanOrEqual -
LessThanOrEqual -
Access -
NamespaceAccess -
Inside -
RelationTo -
RelationFrom -
RelationToFrom -
Indexing -
And -
Or
pub type OrderDirection {
Ascending
Descending
}
Constructors
-
Ascending -
Descending
pub type Permission {
PermissionFull
PermissionNone
PermissionForFull(targets: List(OperationType))
PermissionForNone(targets: List(OperationType))
PermissionForWhere(
targets: List(OperationType),
expression: Node,
)
}
Constructors
-
PermissionFull -
PermissionNone -
PermissionForFull(targets: List(OperationType)) -
PermissionForNone(targets: List(OperationType)) -
PermissionForWhere( targets: List(OperationType), expression: Node, )
The type of schema of a table in SurrealDB.
pub type SchemaType {
Schemafull
Schemaless
}
Constructors
-
Schemafull -
Schemaless
Represents a field in a SELECT statement in SurrealQL.
pub type SelectField {
SelectField(
field: Node,
alias: option.Option(String),
value: Bool,
)
}
Constructors
-
SelectField( field: Node, alias: option.Option(String), value: Bool, )
pub type SelectNS {
SelectNS(
create: fn(String) -> Node,
add_field: fn(Node, Node) -> Node,
add_value_field: fn(Node, Node) -> Node,
add_field_as: fn(Node, Node, String) -> Node,
add_value_field_as: fn(Node, Node, String) -> Node,
with_where: fn(Node, Node) -> Node,
add_order: fn(Node, Node, OrderDirection) -> Node,
with_limit: fn(Node, Node) -> Node,
set_group_all: fn(Node, Bool) -> Node,
set_only: fn(Node, Bool) -> Node,
)
}
Constructors
-
SelectNS( create: fn(String) -> Node, add_field: fn(Node, Node) -> Node, add_value_field: fn(Node, Node) -> Node, add_field_as: fn(Node, Node, String) -> Node, add_value_field_as: fn(Node, Node, String) -> Node, with_where: fn(Node, Node) -> Node, add_order: fn(Node, Node, OrderDirection) -> Node, with_limit: fn(Node, Node) -> Node, set_group_all: fn(Node, Bool) -> Node, set_only: fn(Node, Bool) -> Node, )
pub type TableType {
NormalTable
RelationTable(in: String, out: String)
}
Constructors
-
NormalTable -
RelationTable(in: String, out: String)
Values
pub fn all_create() -> Node
pub fn array_create() -> Node
pub fn create_create(target: String) -> Node
pub const define_access: DefineAccessNS
pub fn define_access_create(name: String) -> Node
pub fn define_access_strategy_to_module(
strategy: DefineAccessStrategy,
) -> module.Module
pub fn define_access_strategy_to_string(
strategy: DefineAccessStrategy,
) -> String
pub fn define_access_target_to_module(
target: DefineAccessTarget,
) -> module.Module
pub fn define_access_target_to_string(
target: DefineAccessTarget,
) -> String
pub fn define_access_type_to_module(
type_: DefineAccessType,
) -> module.Module
pub fn define_access_with_jwt_config(
node: Node,
config: JWTConfiguration,
) -> Node
pub fn define_access_with_strategy(
node: Node,
strategy: DefineAccessStrategy,
) -> Node
pub fn define_access_with_target(
node: Node,
target: DefineAccessTarget,
) -> Node
pub const define_field: DefineFieldNS
pub fn define_field_add_permission(
node: Node,
permission: Permission,
) -> Node
pub fn define_field_create(
name: Node,
table: String,
type_: surreal_type.SurrealType,
) -> Node
pub fn define_field_strategy_to_module(
strategy: DefineFieldStrategy,
) -> module.Module
pub fn define_field_strategy_to_string(
strategy: DefineFieldStrategy,
) -> String
pub fn define_field_with_strategy(
node: Node,
strategy: DefineFieldStrategy,
) -> Node
pub const define_index: DefineIndexNS
pub fn define_index_create(name: String, table: String) -> Node
pub const define_table: DefineTableNS
pub fn define_table_add_permission(
node: Node,
permission: Permission,
) -> Node
pub fn define_table_create(name: String) -> Node
pub fn define_table_strategy_to_module(
strategy: DefineTableStrategy,
) -> module.Module
pub fn define_table_strategy_to_string(
strategy: DefineTableStrategy,
) -> String
pub fn define_table_with_schema(
node: Node,
schema: SchemaType,
) -> Node
pub fn define_table_with_strategy(
node: Node,
strategy: DefineTableStrategy,
) -> Node
pub const function_call: FunctionCallNS
pub const identifier: IdentifierNS
pub fn identifier_create(name: String) -> Node
pub fn jwt_configuration_to_module(
config: JWTConfiguration,
) -> module.Module
pub fn none_create() -> Node
pub fn number_create(value: Float) -> Node
pub fn object_create() -> Node
pub fn operation_type_to_module(
operation_type: OperationType,
) -> module.Module
pub fn operation_type_to_string(
operation_type: OperationType,
) -> String
pub fn operator_to_module(operator: Operator) -> module.Module
Converts an [Operator] into a module for code generation.
pub fn operator_to_string(operator: Operator) -> String
Converts an [Operator] into its [String] representation in SurrealQL.
pub fn order_direction_to_module(
direction: OrderDirection,
) -> module.Module
Converts an [OrderDirection] into a module for code generation.
pub fn order_direction_to_string(
direction: OrderDirection,
) -> String
Converts an [OrderDirection] into its [String] representation in SurrealQL.
pub const parameter: ParameterNS
pub fn parameter_create(name: String) -> Node
pub fn permission_to_module(
permission: Permission,
) -> module.Module
pub fn permission_to_string(permission: Permission) -> String
pub fn replace_variables(
node: Node,
values: List(#(String, surreal_ql.SurrealQL)),
) -> Node
pub fn schema_type_to_module(
schema_type: SchemaType,
) -> module.Module
Converts a [SchemaType] into a module for code generation.
pub fn schema_type_to_string(schema_type: SchemaType) -> String
Converts a [SchemaType] into its [String] representation in SurrealQL.
pub fn select_add_order(
select: Node,
node: Node,
order: OrderDirection,
) -> Node
pub fn select_create(table: String) -> Node
pub fn select_field_to_module(
field: SelectField,
) -> module.Module
pub fn select_field_to_string(field: SelectField) -> String
pub fn self_create() -> Node
pub fn table_type_to_module(
table_type: TableType,
) -> module.Module
pub fn table_type_to_string(table_type: TableType) -> String
pub fn to_module(node: Node) -> module.Module
pub fn update_create(target: String) -> Node
pub fn value_create(value: surreal_ql.SurrealQL) -> Node
pub fn value_create_bool(value: Bool) -> Node
pub fn value_create_float(value: Float) -> Node
pub fn value_create_int(value: Int) -> Node
pub fn value_create_string(value: String) -> Node