schema
ModuleThe schema of audit logs shared by the SQL adapters: their attributes, indexes and column definitions, and how a resource path splits into its type, id and parent.
Contents
use utopia_audit::schema::Attribute;Rust
pub struct AttributeOne attribute (column) of audit logs.
use utopia_audit::schema::Index;Rust
pub struct IndexOne index of audit logs.
use utopia_audit::schema::Resource;Rust
pub struct Resource<'a>The parts of a resource path (database/<id>/collection/<id>).
use utopia_audit::schema::Sql;Rust
pub trait SqlWhat an adapter that stores logs in SQL tables shares: the attribute and index definitions and their column definitions.
Implemented byClickHouseDatabase
use utopia_audit::schema::parse_resource;Rust
pub fn parse_resource(resource: &str) -> Resource<'_>Splits resource into its id, type and parent: any even number of
/-separated segments alternate <type>/<id>; anything else is an id
alone.
Rust
use utopia_audit::schema::parse_resource;
let r = parse_resource("database/db1/table/t1");
assert_eq!((r.kind, r.id, r.parent), ("table", "t1", "database/db1"));
assert_eq!(parse_resource("foo/bar/baz").id, "foo/bar/baz");Rust
pub const COLLECTION: &str = "audit"The collection (Database) or base table name of audit logs.
Rust
pub const LENGTH_KEY: i64 = 255Database::LENGTH_KEY.
Rust
pub const VAR_DATETIME: &str = "datetime"Database::VAR_DATETIME.
Rust
pub const VAR_STRING: &str = "string"Database::VAR_STRING.