Liking cljdoc? Tell your friends :D

postgres.typed.typed-common


*type-registry*clj


*variant-registry*clj


+type-formats+clj


add-bindingclj

(add-binding ctx var-name type-info & {:keys [shape path]})

add-keyclj

(add-key shape key type-info)

add-typedclj

(add-typed typed type-def)

Adds a typed declaration to an app-level typed payload.

Adds a typed declaration to an app-level typed payload.
raw docstring

analysis->typedclj

(analysis->typed analysis)

Converts parsed analysis into app typed maps.

The optional :variants section is retained separately and also attached to matching TableDefs for class-table-aware shape inference.

Converts parsed analysis into app typed maps.

The optional :variants section is retained separately and also attached to
matching TableDefs for class-table-aware shape inference.
raw docstring

attach-variants-to-tableclj

(attach-variants-to-table table variants)

Attaches and validates variants for one qualified TableDef.

Attaches and validates variants for one qualified TableDef.
raw docstring

attach-variants-to-tablesclj

(attach-variants-to-tables typed)

Attaches parsed variant declarations to their qualified TableDefs.

Variant declarations can be parsed before or after their base table because they are retained in a separate typed section. Attaching them after all declarations have been reduced keeps distributed declarations load-order independent while leaving the flat type registry compatible.

Attaches parsed variant declarations to their qualified TableDefs.

Variant declarations can be parsed before or after their base table because
they are retained in a separate typed section.  Attaching them after all
declarations have been reduced keeps distributed declarations load-order
independent while leaving the flat type registry compatible.
raw docstring

binding-context?clj

(binding-context? x)

clear-registry!clj

(clear-registry!)

CONFIDENCE-LEVELSclj


emitted-keyclj

(emitted-key k)

Preserves literal string keys while normalizing keywords/symbols for output.

Preserves literal string keys while normalizing keywords/symbols for output.
raw docstring

empty-jsonb-shapeclj

(empty-jsonb-shape)

empty-typedclj

(empty-typed)

Empty app-level typed payload.

Empty app-level typed payload.
raw docstring

enum-def?clj

(enum-def? x)

enum?clj

(enum? t)

flatten-shapeclj

(flatten-shape shape)

Flattens a JsonbMerge tree into a single map of fields.

Flattens a JsonbMerge tree into a single map of fields.
raw docstring

fn-def?clj

(fn-def? x)

get-key-typeclj

(get-key-type shape key)

get-typeclj

(get-type key)

get-var-pathclj

(get-var-path ctx var-name)

get-var-shapeclj

(get-var-shape ctx var-name)

has-key?clj

(has-key? shape key)

inferred-jsonb-shapeclj

(inferred-jsonb-shape type shape map-schema)

Infers the shape implied by a JSONB alias or a nested map schema.

Plain :jsonb remains unclassified unless its metadata supplies a shape or nested :map schema. The :map and :array aliases retain their historical JSONB emission while carrying their useful semantic shape downstream.

Infers the shape implied by a JSONB alias or a nested map schema.

Plain :jsonb remains unclassified unless its metadata supplies a shape or
nested :map schema. The :map and :array aliases retain their historical
JSONB emission while carrying their useful semantic shape downstream.
raw docstring

jsonb-array?clj

(jsonb-array? x)

jsonb-column-type?clj

(jsonb-column-type? t)

Returns true when a type or primitive TypeRef is emitted as PostgreSQL jsonb.

Returns true when a type or primitive TypeRef is emitted as PostgreSQL jsonb.
raw docstring

jsonb-merge?clj

(jsonb-merge? x)

jsonb-path?clj

(jsonb-path? x)

jsonb-shape-marker?clj

(jsonb-shape-marker? shape)

Returns true for an explicit JSONB shape marker.

Returns true for an explicit JSONB shape marker.
raw docstring

jsonb-shape?clj

(jsonb-shape? x)

JSONB-SHAPESclj

Explicit shapes supported by JSONB column metadata.

Explicit shapes supported by JSONB column metadata.
raw docstring

JSONB-TYPESclj

Column type aliases which are emitted as PostgreSQL jsonb.

Column type aliases which are emitted as PostgreSQL jsonb.
raw docstring

JSONB-VARIANT-PHYSICAL-KEYSclj

deftype.pg attributes which a variant must not replace.

deftype.pg attributes which a variant must not replace.
raw docstring

JSONB-VARIANT-TYPESclj

Semantic types allowed in a class-table JSONB variant contract.

Semantic types allowed in a class-table JSONB variant contract.
raw docstring

lookup-bindingclj

(lookup-binding ctx var-name)

make-column-defclj

(make-column-def name type)
(make-column-def name type opts)

make-contextclj

(make-context)
(make-context bindings)
(make-context bindings shapes)
(make-context bindings shapes paths)

make-enum-defclj

(make-enum-def ns name values dbschema)

make-fn-defclj

(make-fn-def ns name inputs output body-meta dbschema)

make-jsonb-arrayclj

(make-jsonb-array element-type)

make-jsonb-inferenceclj

(make-jsonb-inference return-shape intermediate-vars operations-detected)

make-jsonb-mergeclj

(make-jsonb-merge left right)

make-jsonb-pathclj

(make-jsonb-path segments)
(make-jsonb-path segments root-var)

make-jsonb-shapeclj

(make-jsonb-shape fields)
(make-jsonb-shape fields source-table)
(make-jsonb-shape fields source-table confidence)
(make-jsonb-shape fields source-table confidence nullable?)

make-table-defclj

(make-table-def ns name columns primary-key)
(make-table-def ns name columns primary-key addons entity-meta dbschema)

make-type-refclj

(make-type-ref kind)
(make-type-ref kind ns name)
(make-type-ref kind ns name constraints)

make-type-unionclj

(make-type-union types)

make-variant-defclj

(make-variant-def type class-table field attrs)
(make-variant-def type class-table field attrs source)

merge-shapesclj

(merge-shapes shape1 shape2)

Merges two JSONB shapes. When keys conflict, prefers more specific type. CRITIQUE FIX: This is THE ONE implementation used everywhere. analyze.clj uses this - no local duplication.

Merges two JSONB shapes. When keys conflict, prefers more specific type.
CRITIQUE FIX: This is THE ONE implementation used everywhere.
analyze.clj uses this - no local duplication.
raw docstring

merge-typedclj

(merge-typed & typed-maps)

Merges app-level typed payloads.

Merges app-level typed payloads.
raw docstring

normalize-jsonb-variantclj

(normalize-jsonb-variant attrs)

Normalizes optional JSONB contract markers for a class-table variant.

Variants describe the semantic payload stored in a JSONB column. Unlike a normal column declaration, a variant may omit :type when :shape, :map, or :items establishes the JSONB contract. In that case :jsonb is used only as the semantic base for validation; it does not change the physical column type.

Normalizes optional JSONB contract markers for a class-table variant.

Variants describe the semantic payload stored in a JSONB column.  Unlike a
normal column declaration, a variant may omit :type when :shape, :map, or
:items establishes the JSONB contract.  In that case :jsonb is used only
as the semantic base for validation; it does not change the physical
column type.
raw docstring

normalize-keyclj

(normalize-key k)

Converts kebab-case keyword to snake_case string. Single source of truth for all output generation.

Converts kebab-case keyword to snake_case string.
Single source of truth for all output generation.
raw docstring

pop-scopeclj

(pop-scope ctx)

PRIMITIVE-TYPESclj

Set of primitive PostgreSQL types

Set of primitive PostgreSQL types
raw docstring

primitive?clj

(primitive? t)

push-scopeclj

(push-scope ctx)

ref?clj

(ref? t)

register-type!clj

(register-type! key type-def)

Registers a type definition. Requires a namespaced symbol key.

Registers a type definition. Requires a namespaced symbol key.
raw docstring

register-variant!clj

(register-variant! variant)

Registers a variant and updates an already-registered base TableDef.

Registers a variant and updates an already-registered base TableDef.
raw docstring

set-var-pathclj

(set-var-path ctx var-name path)

set-var-shapeclj

(set-var-shape ctx var-name shape)

shape-at-pathclj

(shape-at-path shape segments)

Returns the nested JsonbShape at the provided path, if known.

Returns the nested JsonbShape at the provided path, if known.
raw docstring

table-def?clj

(table-def? x)

table?clj

(table? t)

type-keyclj

(type-key type-def)

Stable key for a typed definition. Uses a namespaced symbol when possible.

Stable key for a typed definition. Uses a namespaced symbol when possible.
raw docstring

TYPE-KINDSclj


type-ref?clj

(type-ref? x)

type-union?clj

(type-union? x)

typescript-keyclj

(typescript-key k)

Formats a JSON object key for TypeScript property emission.

Formats a JSON object key for TypeScript property emission.
raw docstring

valid-key?clj

(valid-key? key)

Validates that a key is a namespaced symbol (e.g., 'ns/name).

Validates that a key is a namespaced symbol (e.g., 'ns/name).
raw docstring

validate-jsonb-metadata!clj

(validate-jsonb-metadata! opts)

Validates JSONB shape metadata on a column or nested map entry.

The function returns the original metadata map so it can be used in parser pipelines. It deliberately accepts plain :jsonb without a marker, preserving the existing open-ended JSONB form.

Validates JSONB shape metadata on a column or nested map entry.

The function returns the original metadata map so it can be used in
parser pipelines. It deliberately accepts plain :jsonb without a marker,
preserving the existing open-ended JSONB form.
raw docstring

variant-def?clj

(variant-def? x)

variant-keyclj

(variant-key variant)

Returns the stable dispatch key for a VariantDef.

Returns the stable dispatch key for a VariantDef.
raw docstring

variants-for-typeclj

(variants-for-type type)

Returns registered variants for a qualified table type.

Returns registered variants for a qualified table type.
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