Instantiates the OKF storage adapter.
Optionalparams: BackendParametersConfiguration parameters containing database path and optional settings.
Protected_Protected_Protected_ProtecteddataProtectedstorageStaticPKEY_The string identifier for primary keys, mapped to 'id' by default.
Protected_Resolves the canonical database path for a record, respecting standard collection structures and hierarchical subcollection configurations.
Optionaluid: stringProtected_Protected_Processes raw data entries to convert relational reference objects into native database foreign key IDs
if the adapter has been configured with useNativeForeignKeys = true.
Protected_Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. The default implementation fetches all matching records and performs in-memory aggregation. Specific database adapters should override this to perform native query aggregation.
The Query instance defining the collection and filters.
The aggregate operation.
Optionalproperty: stringThe name of the property to aggregate.
A promise resolving to the aggregated result.
Creates a new document on disk matching the OKF structure.
The payload object.
OptionaldesiredUid: stringOptional custom UID.
The hydrated DataObject.
Deletes the file from the filesystem.
The target DataObject to remove.
The cleared DataObject.
Recursively removes the directory associated with a collection.
The collection folder path to clear.
Removes a middleware from the pipeline by its class name.
The exact name of the middleware class to remove.
ProtecteddeserializeProtectedevaluateEvaluates active query filters against a single DataObject instance in memory. Supports advanced operator comparisons (equals, contains, containsAny, etc.).
The hydrated DataObject instance.
Optionalfilters: Filter[] | FiltersActive constraints.
true if the object matches all criteria, false otherwise.
Orchestrates the sequential execution of all attached middlewares for a given action.
The payload traversing the middlewares.
The context (READ, CREATE, UPDATE, DELETE).
Whether to run the before or after pipeline.
Optionalparams: MiddlewareParamsOptional parameters passed down to the middlewares.
A promise resolving to the potentially mutated DataObject.
Parses markdown body to extract all internal hyperlinks (Obsidian-style [[WikiLinks]] or markdown Label links).
The markdown text content.
Array of unique target slugs or paths.
Queries the local files by scanning directories and evaluating conditions in-memory.
Base template representing the target collection.
Optionalfilters: Filter[] | FiltersActive constraints.
Optionalpagination: SortAndLimitLimits and sorting directives.
QueryResult containing found items and diagnostics.
ProtectedfindGenerates the SQL up and down statements to create a collection table.
Generates the SQL up and down statements to apply a schema delta to a collection.
Helper method to extract the destination collection name from a DataObject.
The DataObject evaluating the context.
The resolved collection string.
ProtectedgetResolves the relative storage path matching the OKF collection and metadata hierarchy. For telemetry: telemetry/YYYY-MM-DD/{type}/{HHMMSS}-{millis}-{bassinId}.json For other: {collection}/{uid}.json
The data object model being persisted.
The unique identifier of the record.
The relative file path string.
Retrieves a specific configuration parameter.
The parameter key to fetch.
The value associated with the key, or undefined.
Returns true if a given middleware is attached
boolean
Process Query instance and return result
Array
Executes a raw query on the backend. Only supported by SQL adapters.
Optionalparams: any[]Hydrates a DataObject by reading its matching flat file on disk.
The target skeleton DataObject.
The populated DataObject.
ProtectedresolveResolves incoming backlinks pointing to the target UID by scanning the collection.
The collection name.
The UID of the target document.
Array of backlink references { id, title, category }.
ProtectedserializeOverrides or adds a backend configuration parameter dynamically.
The parameter key to modify.
The new value to assign.
Overwrites the document with the updated payload.
The modified payload.
The DataObject instance.
File-based persistence adapter conforming to the Open Knowledge Format (OKF) standard. Serializes entities into flat directory layouts, optionally delegating to a Storage Adapter.