A utility library to support Polyglot Persistence / Storage implementations.
  • TypeScript 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-05 02:39:10 +00:00
.forgejo/workflows Initial code commit 2026-07-21 12:16:50 -05:00
src Attempting to fix issue with fullupdate where mergedEntity didn't have correct properties 2026-10-04 21:38:28 -05:00
.gitignore Initial code commit 2026-07-21 12:16:50 -05:00
LICENSE Initial code commit 2026-07-21 12:16:50 -05:00
package.json [Forgejo Actions] Update version to v1.0.8 2026-10-05 02:39:10 +00:00
README.md Initial code commit 2026-07-21 12:16:50 -05:00
tsconfig.json Initial code commit 2026-07-21 12:16:50 -05:00
yarn.lock Initial code commit 2026-07-21 12:16:50 -05:00

Polyglot Persistence Utilities Library

This library is intended to provide utilities to help make creating polyglot storage / persistence implementations easier.

Example Usage

The following shows how to use the library

import { createPolyglotRepository } from '@BridgemanAccessible/ba-polyglot-storage/repos';
import { Entity } from './entity/Entity.js';
import type { Properties } from './types/Properties.js';

// 1. Generate the custom class using the factory function
const EventRepoClass = createPolyglotRepository<Entity, Properties>(Entity);

// 2. Export the initialization wrapper
export const EntityRepo = async (
    db: DB = DB.getDefaultDB(), 
    nosqlStorage: NoSQLStorage<any, any> = NoSQLStorage.getDefaultNoSQLStorage()
) => { 
    // Invoke the static method on the generated class
    return await EventRepoClass.getRepo(db, nosqlStorage); 
};