GizStack
View .mdOpen in ChatGPTOpen in Claude

gizmodel

The application data layer: shapes, typed queries, sources, policies, live feeds and search on one SQL API. Import a module by name, for example import * as Store from "gizmodel/store";. Each page lists the module's public declarations exactly as an installed toolchain provides them.

ModulePurpose
gizmodel/copyThe pieces every copy into GizDB shares: the page credit, the rows a source answers, and the one proof of a copy, an order-free checksum of its rows (Store.copy and Store.move, gizdb migrate).
gizmodel/core/analyzerText analysis: the tokens of a text for the inverted index and for queries.
gizmodel/core/columnColumns: the one in-memory layout of data, shared by segments, the delta's scans and the executor's batches.
gizmodel/core/invertedThe inverted index of a text column and BM25 top-k search over it. One byte layout is the index, in memory and in a segment's file (segment.giz), read in pages of PAGE bytes: a resident index holds every page, a cold one the pages its queries read.
gizmodel/core/kernelsThe vector loops over column storage: the one owner of SIMD in the GizDB executor.
gizmodel/core/namesQuoted names that keep their case.
gizmodel/core/parquetApache Parquet files read as GizDB columns (model/source.giz reads them as a table): the footer's schema and row groups, and each row group's column chunks decoded into column.giz columns, a dictionary-encoded text chunk keeping its dictionary as the column's.
gizmodel/dataA stored application's typed records, by their Model.Shape: on a GizDB engine this process serves, or on a SQL store.
gizmodel/decimalExact decimals, as PostgreSQL's NUMERIC: a value is C × 10^-s with a scale s of 0..16383 and at most 131072 digits before the point.
gizmodel/errorTyped failures shared by database owners; protocol spelling lives in sql/errors.giz.
gizmodel/gatewho may read and write which rows of a Shape.
gizmodel/heldthe types of a typed read and of the Db that runs it.
gizmodel/insertthe INSERT of a stored Model.Shape's records, as the tree every engine runs.
gizmodel/modela record type's meaning as a value (a Shape), and what is derived from it besides HTML: typed input validation, SQL wire rows, DDL for SQLite and PostgreSQL, additive migration, JSON and agent tool schemas.
gizmodel/policyThe DAL's Policy.
gizmodel/querya typed read of stored records.
gizmodel/relayrealtime as a position in a log the database keeps.
gizmodel/schemaOne pure schema planner.
gizmodel/searchA search index of any source of documents: a folder (a POSIX tree or a GizFS mount) or a system of your own that implements Source.
gizmodel/semanticAnalytical meaning is metadata attached to stable declarations.
gizmodel/sourceOne typed data-source contract.
gizmodel/sql/aggnameswhich function names are aggregates, the one owner of that list.
gizmodel/sql/astThe SQL syntax tree.
gizmodel/sql/batcha batch of typed columns and the replies that carry batches (FinitePoll, Rows, Delivery).
gizmodel/sql/catalog/gucsPostgreSQL's configuration parameters, as pg_settings and SHOW ALL list them: the one owner of their names, boot values, units, limits and descriptions.
gizmodel/sql/catalog/routineStored routines and triggers as the catalog keeps them: one text per object (Engine.setObject), written by the parser from CREATE FUNCTION, PROCEDURE or TRIGGER in any dialect and read back by the binder (which inlines functions, proc.giz) and the session (which runs the rest).
gizmodel/sql/catalog/sequenceSequences as Oracle and PostgreSQL define them: a step (negative counts down), bounds, and CYCLE, which starts again at the far bound instead of failing.
gizmodel/sql/errorsProtocol representations have one owner; no diagnostic text classifies a failure.
gizmodel/sql/lexSQL tokens.
gizmodel/sql/parseThe SQL parser: recursive descent over lex.giz's tokens into ast.giz's nodes.
gizmodel/sql/renderThe one place the DAL prints a syntax tree as SQL text of a dialect: external pushdown, the SQL stores of gizmodel/store and gizmodel/data, and the views of gizweb/view.
gizmodel/sql/treeA stored table that follows a record type.
gizmodel/sql/types/dialectA SQL dialect as a value: its name and the rules where the engines it imitates differ in meaning, not spelling.
gizmodel/sql/types/geoPostgreSQL's geometric types (point, lseg, line, box, path, polygon, circle) as PostgreSQL 16's geo_ops.c reads, writes and compares them.
gizmodel/sql/types/inetPostgreSQL's network address types inet and cidr as PostgreSQL 16's network.c and inet_net_pton.c read, write and compare them.
gizmodel/sql/types/jsonJSON as PostgreSQL 16 reads, prints and queries it: JSON text as exact items (json, jsonb), and SQL/JSON paths, the jsonpath type: its parser (jsonpath_scan.l, jsonpath_gram.y), its canonical text (jsonpath_out) and its evaluation (jsonpath_exec.c).
gizmodel/sql/types/lsnPostgreSQL's pg_lsn type as PostgreSQL 16's pg_lsn.c reads, writes and computes it.
gizmodel/sql/types/scalarWhat every SQL function shares: the context it may read (Cx), the function value (Fn, Scalar) and the helpers that make and read argument values.
gizmodel/sql/types/snowball
gizmodel/sql/types/tsdict
gizmodel/sql/types/tsearchText search as PostgreSQL 16 does it: the tsvector and tsquery types and their canonical text (tsvector_parser.c, tsvector.c, tsquery.c), the default parser (wparser_def.c) and its tokens through the configurations and dictionaries of tsdict.giz, to_tsquery and its relatives, @@ (tsvector_op.c TS_execute), ts_rank and ts_rank_cd (tsrank.c) and the editing functions.
gizmodel/sql/types/typesSQL values: how a declared type is stored, what text a value reads as, casts, comparison, arithmetic, dates and intervals, and printing, for each dialect.
gizmodel/sql/types/xmlPostgreSQL's xml type: well-formedness, a node tree, XPath 1.0 and serialization (PostgreSQL's xml.c over libxml2).
gizmodel/storethe database a web app keeps its records in, by its location.
gizmodel/typedTyped data contracts: Slot, Codec, the codecs, logical Contract and the exact JSON transport of a Value.
gizmodel/valueValues, types and schemas, and how they are written with the words, blobs and order keys of gizfs/codec, the one binary encoding of stored bytes (the log and segment files alike).