Skip to content

ingitdb/ingitdb-schema

Repository files navigation

inGitDB JSON Schemas

This directory contains JSON Schema definitions for inGitDB configuration and collection definition files.

Schemas

ingitdb-root-config.schema.json

Schema for the .ingitdb.yaml root configuration file. This file lives at the root of an inGitDB database repository and maps collection IDs to their directory paths.

Key properties:

Property Type Description
rootCollections map[string]string Maps collection IDs to relative directory paths. A trailing * auto-discovers sub-collections.

ingitdb-collection.schema.json

Schema for .ingitdb-collection.yaml files. Each collection directory contains one of these files to define its structure.

Top-level properties:

Property Type Required Description
titles map[string]string No Localized collection titles keyed by locale code.
record_file RecordFileDef Yes Defines file naming, format, and record storage type.
data_dir string No Relative path to the data files directory.
columns map[string]ColumnDef Yes Column definitions (at least one required).
columns_order string[] No Display order of columns (unique, no duplicates).
default_view string No ID of the default view.

RecordFileDef — defines how records are stored:

Property Type Required Description
name string Yes File name pattern (supports {key} and column placeholders).
format string Yes Serialization format (e.g. JSON, YAML).
type enum Yes map[string]any · []map[string]any · map[string]map[string]any

ColumnDef — defines a column in the collection:

Property Type Required Description
type string / enum Yes Data type: string, int, float, bool, date, time, datetime, any, map[locale]string, or map[keyType]valueType.
title string No Single-locale display title.
titles map[string]string No Localized titles keyed by locale.
valueTitle string No Display title for the column value.
required boolean No Whether a value is required (default: false).
length integer No Exact required length.
min_length integer No Minimum length.
max_length integer No Maximum length.
foreign_key string No Reference to another collection (e.g. auth.users).

Usage

Reference the schemas in your YAML files for IDE validation and autocompletion:

# yaml-language-server: $schema=./schemas/ingitdb-collection.schema.json

Source of Truth

These schemas are derived from the Go struct definitions in ingitdb-go/ingitdb/:

About

Defines IngitDB definition schema

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •