Expand description
Schema caching for improved performance.
This module provides:
- Schema caching to avoid re-parsing
- String interning for documentation strings
- Lazy computed fields
§Examples
use prax_schema::cache::{SchemaCache, DocString};
// Cache parsed schemas
let mut cache = SchemaCache::new();
let schema = cache.get_or_parse("model User { id Int @id }").unwrap();
let schema2 = cache.get_or_parse("model User { id Int @id }").unwrap();
// schema2 is the same Arc as schema (cached)
// Intern documentation strings
let doc1 = DocString::intern("User profile information");
let doc2 = DocString::intern("User profile information");
// doc1 and doc2 share the same allocationStructs§
- Cache
Stats - Statistics for the schema cache.
- DocString
- An interned documentation string.
- Field
Attrs Cache - Cached field attribute values.
- Lazy
Field Attrs - Lazily computed field attributes.
- Schema
Cache - A cache for parsed schemas.
- Validation
Type Pool - Pool of commonly used validation types.
- Validator
Def - A cached validator definition.
Enums§
- Validator
Type - Type of validator.
Statics§
- VALIDATION_
POOL - Global validation type pool.