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.
(columns-by-relation db relation-oid)(columns-by-relation db relation-oid live-only?)All persisted column subobjects for a relation in attnum order. Dropped
tombstones are included unless live-only? is true.
All persisted column subobjects for a relation in attnum order. Dropped tombstones are included unless `live-only?` is true.
(create-columns-tx relation-oid columns)Create durable column subobject rows. The relation may be created in the
same transaction, so its lookup ref need not resolve in db yet.
Create durable column subobject rows. The relation may be created in the same transaction, so its lookup ref need not resolve in `db` yet.
(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.
(initialization-tx legacy-objects next-oid)(initialization-tx legacy-objects legacy-columns next-oid)(initialize-catalog txdb legacy-objects legacy-columns next-oid)Transaction function for an atomic, idempotent initial migration.
legacy-objects must already have deterministic, collision-free OIDs.
Transaction function for an atomic, idempotent initial migration. `legacy-objects` must already have deterministic, collision-free OIDs.
(migrate-v1-to-v2 txdb legacy-columns)Atomic catalog-v1 upgrade that installs durable column subaddresses.
Atomic catalog-v1 upgrade that installs durable column subaddresses.
(migrate-v2-to-v3 txdb tx-data expected-next next-oid)Atomic address-completeness migration. tx-data contains preplanned
generic object and column rows; allocator/version CAS operations make a
stale or concurrent plan fail instead of partially merging.
Atomic address-completeness migration. `tx-data` contains preplanned generic object and column rows; allocator/version CAS operations make a stale or concurrent plan fail instead of partially merging.
(object-by-identity db class-oid namespace-oid name)(object-by-identity db class-oid namespace-oid name tail)(rename-column-tx db relation-oid attnum new-name new-storage-ident)Rename a live column without changing its relation-local address or physical Datahike storage ident.
Rename a live column without changing its relation-local address or physical Datahike storage ident.
(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.
(reserve-user-oids-tx db n)Reserve n noncolliding OIDs with one allocator CAS. Used when PostgreSQL
creates coupled catalog objects, such as a relation and its row type.
Reserve `n` noncolliding OIDs with one allocator CAS. Used when PostgreSQL creates coupled catalog objects, such as a relation and its row type.
(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.
(tombstone-column-tx db relation-oid attnum)Mark a column address dropped while retaining its attnum. The live name key is released so a later column with the same SQL name receives a fresh address. Revision guarding belongs to the surrounding relation mutation.
Mark a column address dropped while retaining its attnum. The live name key is released so a later column with the same SQL name receives a fresh address. Revision guarding belongs to the surrounding relation mutation.
(valid-user-oid? oid)True for an allocatable PostgreSQL user OID. OID is uint32, while values below FirstNormalObjectId belong to PostgreSQL's bootstrap catalogs.
True for an allocatable PostgreSQL user OID. OID is uint32, while values below FirstNormalObjectId belong to PostgreSQL's bootstrap catalogs.
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 |