Templated Abstract Polymorphic Database - A flexible object model library
Project description
Templated Abstract Polymorphic Database
Templated Abstract Polymorphic Database, or TAPDB, is a reusable PostgreSQL-backed substrate for typed, versioned, auditable entities.
It is intentionally not a domain application. TAPDB provides the generic persistence and runtime mechanics that higher-level repos use to model their own business objects. Bloom is a motivating example of the kind of system TAPDB supports, but Bloom-specific workflow semantics do not belong in TAPDB itself.
At a high level TAPDB combines:
- SQLAlchemy polymorphic models over a small, schema-stable core
- template packs that define object shape and behavior
- concrete instances created from those templates
- lineage edges that describe relationships and history
- audit, outbox, and inbox tables that preserve change and delivery state
- explicit domain, application, and tenant scoping
flowchart TB
App["Client application repo\n(Bloom or another domain app)"]
CLI["tapdb CLI"]
Lib["daylily_tapdb library"]
DB["PostgreSQL\nschema + triggers + RLS"]
Core["TAPDB core substrate\nTemplates / Instances / Lineage / Audit / Outbox / Inbox"]
Domain["App-owned domain code\nTemplates, workflows, UI, integrations"]
App --> Domain
Domain --> CLI
Domain --> Lib
CLI --> Core
Lib --> Core
Core --> DB
DB --> Core
Quickstart
The repo follows a CLI-first workflow. Start by activating the repo environment:
source ./activate
The canonical operational form for runtime commands is:
tapdb --config <path> --env <name> ...
Smoke the installed CLI surface first:
tapdb --help
tapdb version
bash examples/readme/00_smoke.sh
For a fuller local bootstrap, use the namespaced config flow and then bring up the local runtime:
tapdb --config ~/.config/tapdb/<client-id>/<database-name>/tapdb-config.yaml \
db-config init \
--client-id <client-id> \
--database-name <database-name> \
--euid-client-code <client-code> \
--env dev \
--db-port dev=5533 \
--ui-port dev=8911
tapdb --config ~/.config/tapdb/<client-id>/<database-name>/tapdb-config.yaml \
--env dev \
bootstrap local --no-gui
tapdb --config ~/.config/tapdb/<client-id>/<database-name>/tapdb-config.yaml \
--env dev \
info --json
If optional workflow packs are present in the config, add --include-workflow to the bootstrap command. If you want the generated scripts rather than inline commands, use the companion examples under examples/readme/:
examples/readme/00_smoke.shexamples/readme/10_bootstrap_local.shexamples/readme/20_python_api.py
Mental Model
TAPDB’s core model is deliberately small:
template: a blueprint, stored as ageneric_templaterow and usually seeded from JSON packsinstance: a concrete object, stored as ageneric_instancerow and created from a templatelineage: a directed relationship, stored asgeneric_instance_lineageaudit: immutable change history inaudit_logoutbox: durable dispatch state for cross-service deliveryinbox: durable receipt state for inbound messages
The library surface is built around those concepts:
TemplateManagerresolves template codes to seeded templatesInstanceFactorymaterializes instances from templates- lineage helpers traverse parent/child relationships
- outbox helpers enqueue, claim, deliver, and record message attempts
The important mental shift is that template packs describe shape, not business truth. Application repos own domain semantics and TAPDB stores the substrate that those semantics sit on.
Identity And Scope
TAPDB uses multiple identity layers on purpose:
uidis the internal BIGINT primary keyeuidis the external Meridian identifier used on labels, links, APIs, and human-facing referencesdomain_codescopes a row or identifier to a Meridian domainissuer_app_coderecords the issuing application and is not part of the EUID stringtenant_idis the database tenancy scope and is separate from Meridian domain scoping
Do not infer business meaning from an EUID prefix. EUIDs are opaque by design. The string helps validation and transport; the real meaning lives in database lookup and application context.
Boundaries
TAPDB owns:
- template seeding and validation
- polymorphic persistence
- lineage and graph traversal
- audit and soft-delete behavior
- outbox/inbox delivery state
- CLI-managed runtime and database lifecycle
Application repos own:
- domain semantics
- domain template packs
- workflow rules and business policy
- UI and API affordances on top of TAPDB
- integration-specific behavior
That boundary is the point of the project. TAPDB is the substrate, not the business system.
Docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daylily_tapdb-4.1.0.tar.gz.
File metadata
- Download URL: daylily_tapdb-4.1.0.tar.gz
- Upload date:
- Size: 321.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cedcf9185f8e299662fa01d73eb85bef237763ff11258f2bfe482d675089bc44
|
|
| MD5 |
49698646c3f03ea9dd3a92ba187f49b0
|
|
| BLAKE2b-256 |
2a2f3da8044041d80995391188f5bc8a057e5691b463b2af16528e1162f08649
|
File details
Details for the file daylily_tapdb-4.1.0-py3-none-any.whl.
File metadata
- Download URL: daylily_tapdb-4.1.0-py3-none-any.whl
- Upload date:
- Size: 231.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6705cd3063efa2af0ee5c843fabfe084442c1e8d8386b17d2082819481e04ba
|
|
| MD5 |
2391b9c1e91de481448003b08118b2fc
|
|
| BLAKE2b-256 |
718972006232f3d7b6f4de881c33d121f6e2a2fcf391ee258fa1ae88c3a0a065
|