wasm-dbms-macros

Runtime-agnostic procedural macros for the wasm-dbms DBMS engine.
This crate provides procedural macros to automatically implement traits
required by the wasm-dbms engine.
Provided Derive Macros
Encode
Automatically implements the Encode trait for structs, generating binary serialization
and deserialization methods for memory storage.
use Encode;
Table
Given a struct representing a database table, automatically implements the TableSchema
trait with all the necessary types. Generates:
${StructName}Record- implementingTableRecord${StructName}InsertRequest- implementingInsertRecord${StructName}UpdateRequest- implementingUpdateRecord${StructName}ForeignFetcher(only if foreign keys are present)
use ;
Table Attributes
#[table = "table_name"]: Specifies the table name in the database.#[alignment = N]: (optional) Specifies the alignment for table records.#[primary_key]: Marks a field as the primary key.#[foreign_key(entity = "EntityName", table = "table_name", column = "column_name")]: Defines a foreign key relationship.#[sanitizer(SanitizerType)]: Specifies a sanitizer for the field.#[validate(ValidatorType)]: Specifies a validator for the field.#[custom_type]: Marks a field as a custom data type.
CustomDataType
Bridges user-defined types into the Value system. The type must also derive Encode
and implement Display.
use ;
License
This project is licensed under the MIT License. See the LICENSE file for details.