Liking cljdoc? Tell your friends :D

datahike.pg.catalog.objects

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.
raw docstring

addressclj

(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.
raw docstring

address-keyclj

(address-key class-oid object-oid)

Stable structural serialization of a top-level catalog address.

Stable structural serialization of a top-level catalog address.
raw docstring

bump-revision-txclj

(bump-revision-tx db class-oid object-oid)

catalog-entityclj

(catalog-entity db)

catalog-keyclj


catalog-relation-oidsclj

pg_class OIDs of the system catalogs we materialise, from each header's CATALOG(name, oid, ...) declaration (src/include/catalog/*.h). What a catalog row's tableoid answers; pg_dump keys every object it reads by (tableoid, oid). Views have no tableoid and are deliberately absent.

pg_class OIDs of the system catalogs we materialise, from each header's
`CATALOG(name, oid, ...)` declaration (src/include/catalog/*.h). What a
catalog row's `tableoid` answers; pg_dump keys every object it reads by
(tableoid, oid). Views have no tableoid and are deliberately absent.
raw docstring

catalog-versionclj


column-address-keyclj

(column-address-key relation-oid attnum)

column-by-attnumclj

(column-by-attnum db relation-oid attnum)

column-by-nameclj

(column-by-name db relation-oid name)

column-name-keyclj

(column-name-key relation-oid name)

columns-by-relationclj

(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.
raw docstring

create-columns-txclj

(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.
raw docstring

create-object-txclj

(create-object-tx db
                  {:keys [class-oid oid kind name storage-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.
raw docstring

creation-namespaceclj

(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.
raw docstring

drop-object-txclj

(drop-object-tx db class-oid object-oid)

drop-relation-columns-txclj

(drop-relation-columns-tx db relation-oid)

explicit-search-namespacesclj

(explicit-search-namespaces db entries user-name)

Resolve explicit search_path entries in order, skipping nonexistent schemas.

Resolve explicit search_path entries in order, skipping nonexistent schemas.
raw docstring

first-user-oidclj


identity-keyclj

(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.
raw docstring

initialization-txclj

(initialization-tx legacy-objects next-oid)
(initialization-tx legacy-objects legacy-columns next-oid)

initialize-catalogclj

(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.
raw docstring

max-oidclj


migrate-v1-to-v2clj

(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.
raw docstring

migrate-v2-to-v3clj

(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.
raw docstring

move-relation-object-txclj

(move-relation-object-tx object namespace-oid)

Move a relation or its row type to a namespace without changing its OID.

Move a relation or its row type to a namespace without changing its OID.
raw docstring

namespace-by-nameclj

(namespace-by-name db name)

namespace-by-oidclj

(namespace-by-oid db oid)

next-attnumclj

(next-attnum db relation-oid)

object-by-addressclj

(object-by-address db class-oid object-oid)

object-by-identityclj

(object-by-identity db class-oid namespace-oid name)
(object-by-identity db class-oid namespace-oid name tail)

object-by-storage-nameclj

(object-by-storage-name db storage)

object-namespace-oidclj

(object-namespace-oid db object)

Read a namespace reference from either a pulled object or an entity.

Read a namespace reference from either a pulled object or an entity.
raw docstring

objects-by-kindclj

(objects-by-kind db kind)

objects-in-namespaceclj

(objects-in-namespace db namespace-oid)

pg-catalog-namespace-oidclj


pg-class-oidclj


pg-extension-oidclj


pg-namespace-oidclj


pg-proc-oidclj


pg-trigger-oidclj


pg-type-oidclj


primary-index-oidclj

(primary-index-oid db relation-oid)

public-namespace-oidclj


public-relation-nameclj

(public-relation-name db storage)

public-relation-storage-nameclj

(public-relation-storage-name db name)

rename-column-txclj

(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.
raw docstring

rename-object-txclj

(rename-object-tx db class-oid object-oid new-name identity-tail)

rename-table-txclj

(rename-table-tx db relation-oid new-name)

Move a table and its row type to a new SQL name, preserving their OIDs and the table's storage namespace.

Move a table and its row type to a new SQL name, preserving their OIDs
and the table's storage namespace.
raw docstring

reserve-user-oid-txclj

(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.
raw docstring

reserve-user-oids-txclj

(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.
raw docstring

resolve-search-pathclj

(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.
raw docstring

schemaclj

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.
raw docstring

scoped-index-identclj

(scoped-index-ident oid)

scoped-table-name-overridesclj

(scoped-table-name-overrides db)

Map the SQL [schema name] of each table with a separate storage name.

Map the SQL [schema name] of each table with a separate storage name.
raw docstring

table-name-overridesclj

(table-name-overrides db)

Map physical table namespaces to their SQL names in this catalog snapshot.

Map physical table namespaces to their SQL names in this catalog snapshot.
raw docstring

table-namespace-objectsclj

(table-namespace-objects db table)

The table and catalog objects that use the table's namespace.

The table and catalog objects that use the table's namespace.
raw docstring

tombstone-column-txclj

(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.
raw docstring

v1-to-v2-txclj

(v1-to-v2-tx legacy-columns)

v2-to-v3-txclj

(v2-to-v3-tx tx-data expected-next next-oid)

valid-user-oid?clj

(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.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close