Persistent PostgreSQL catalog identities for user-defined objects.
PostgreSQL identifies an object by (catalog relation OID, object OID), with an optional sub-object number for columns. Keeping that shape here lets routines, triggers, dependencies, and future catalog work share one transactional identity model instead of inventing per-feature IDs.
Persistent PostgreSQL catalog identities for user-defined objects. PostgreSQL identifies an object by (catalog relation OID, object OID), with an optional sub-object number for columns. Keeping that shape here lets routines, triggers, dependencies, and future catalog work share one transactional identity model instead of inventing per-feature IDs.
(address class-oid object-oid)(address class-oid object-oid sub-id)A PostgreSQL object address. sub-id is zero for the object itself and
positive for a sub-object such as a table column.
A PostgreSQL object address. `sub-id` is zero for the object itself and positive for a sub-object such as a table column.
(address-key class-oid object-oid)Stable structural serialization of a top-level catalog address.
Stable structural serialization of a top-level catalog address.
(create-object-tx db
{:keys [class-oid oid kind name namespace-oid owner-oid
revision legacy-oid? identity-tail]
:or {owner-oid 10 revision 1}})Build an object-row transaction. Namespace may be nil for cluster-global objects; otherwise it must already exist. The two :db.unique/value keys are the atomic stale-reader guard: Datahike rejects duplicates and cannot upsert/merge them as it would :db.unique/identity.
Build an object-row transaction. Namespace may be nil for cluster-global objects; otherwise it must already exist. The two :db.unique/value keys are the atomic stale-reader guard: Datahike rejects duplicates and cannot upsert/merge them as it would :db.unique/identity.
(creation-namespace db entries user-name)The first existing explicit search_path entry. The implicit pg_catalog entry used for lookup is deliberately not a creation target.
The first existing explicit search_path entry. The implicit pg_catalog entry used for lookup is deliberately not a creation target.
(identity-key class-oid namespace-oid name)(identity-key class-oid namespace-oid name tail)Stable structural serialization of a namespace-scoped object identity.
tail carries kind-specific identity, notably a routine's argument types.
Stable structural serialization of a namespace-scoped object identity. `tail` carries kind-specific identity, notably a routine's argument types.
(initialize-catalog txdb legacy-objects next-oid)Transaction function for an atomic, idempotent version-1 migration.
legacy-objects must already have deterministic, collision-free OIDs.
Transaction function for an atomic, idempotent version-1 migration. `legacy-objects` must already have deterministic, collision-free OIDs.
(object-by-identity db class-oid namespace-oid name)(object-by-identity db class-oid namespace-oid name tail)(reserve-user-oid-tx db)Reserve one currently-unused user OID with a CAS operation that the caller must transact together with the object creation. Allocation is therefore rolled back with its DDL and naturally chains against a speculative DB.
Reserve one currently-unused user OID with a CAS operation that the caller must transact together with the object creation. Allocation is therefore rolled back with its DDL and naturally chains against a speculative DB.
(resolve-search-path db entries user-name)Resolve PostgreSQL search_path entries to existing namespace OIDs.
pg_catalog is implicitly searched first unless explicitly positioned.
$user contributes a schema only when it exists.
Resolve PostgreSQL search_path entries to existing namespace OIDs. pg_catalog is implicitly searched first unless explicitly positioned. `$user` contributes a schema only when it exists.
Datahike schema for the shared user-object catalog. Address and identity keys use strict unique/value semantics: an attempted duplicate must fail, never upsert or merge two independently-created objects.
Datahike schema for the shared user-object catalog. Address and identity keys use strict unique/value semantics: an attempted duplicate must fail, never upsert or merge two independently-created objects.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |