Field Attributes

AttributeDescriptionTypeOptional
renameRenames the field.stringY
link_oneSpecifies a relationship to a singular record in another node table in the database.model=NodeEdgeNode, connection ->edge->nodeY
link_selfSpecifies a relationship to a singular record in the same node table in the database.NodeY
link_manySpecifies a relationship to multiple records in another node table in the database.`Vec<S
typeSpecify the valid surrealdb field's type. One of any, array, bool, datetime, decimal, duration, float, int, number, object, string, record.surrealdb field typeY
assertAssert the field's value meets a certain criteria using the an filter using value() function as an operation (e.g value().is_not(NONE)) or in cond helper function for more complex filter assertion. e.g cond(value().is_not(NONE)).and(value().like("@codebreather")).inline code stringY
assert_fnProvide a function to assert the field's value meets a certain criteria. This is similar to assert but is intended for an already created external function which is useful when reusing an assertion e.g is_email.function name stringY
item_typeOnly when for nested array. Specifies the type of the items of the array.Option<FieldTypeWrapper>Y
item_assertOnly used for nested array. Asserts a condition on the content.Option<syn::LitStr>Y
item_assert_fnOnly used for nested array. Specifies the function to assert a condition on the content.Option<syn::Path>Y
defineGenerates a DEFINE FIELD statement for the table. This overrides other specific definitions to prevent confusion and collision. You can also invoke an external function directly rather than inlining the function e.g define = "define_age()"inline code stringY
define_fnGenerates a DEFINE FIELD statement for the table. This overrides other specific definitions to prevent confusion and collision. Same as define attribute but expects the function name instead rather than invocation i.e define_age instead of define_age(). You can also invoke an external function directly rather than inlining the function e.g `define = "def
skip_serializingWhen true, this field will be omitted when serializing the struct.boolY