Bases#

A base is one configured backend store, plus the collections it maps onto the domain model. Each file under .katalyst/bases/ is one base, named for its filename stem. There is no implicit base; katalyst init writes a default local one.

KeyRequiredDefaultMeaning
typenofilesystemBackend kind: filesystem or sqlite.
rootno.Base root directory, relative to the repo root. Collection paths resolve against it.
pathfor sqlite-SQLite database path, relative to the repo root. Alias for root on SQLite bases.
filesystemChecksno-Filesystem-attached checks for raw files under a filesystem base. Valid only when type: filesystem.
collectionsno-Map of collection name -> definition. See Collections.
# .katalyst/bases/local.yaml
type: filesystem
root: .
collections:
  books:
    path: notes/books
    schema: book
    checks:
      - kind: markdown_title_matches_h1

Collection names are unique across the whole project (selectors are <collection>/<item>, with no base qualifier).

Filesystem bases may also declare filesystemChecks for rules that run before or beside collections. Each entry selects files under the base root, then runs checks whose descriptors support the filesystem target:

# .katalyst/bases/local.yaml
type: filesystem
root: .
filesystemChecks:
  - name: docs
    path: docs/content
    include: ["**/*.md"]
    exclude: ["**/_generated/**"]
    parseFailures: error
    checks:
      - kind: filesystem_name_case
        style: kebab
      - kind: filesystem_unmatched_files
collections: {}
KeyRequiredDefaultMeaning
namenopathDiagnostic label and future selector handle.
pathno.Scope root, relative to the base root.
includeyes-Glob patterns relative to path; selected files match at least one.
excludeno[]Glob patterns removed from the selected set and from unmatched-file reporting.
parseFailuresnoerrorerror fails the run; warning reports advisory parse failures when a check needs document data.
checksyes-Check instances to run against selected files or the selected file set.

SQLite bases use one table per collection. Each row is one item:

# .katalyst/bases/db.yaml
type: sqlite
path: content.sqlite
collections:
  books:
    table: books
    id: slug
    attributes:
      title: title
      status: status
      author:
        columns:
          first: author_first
          last: author_last
    content:
      kind: markdown
      column: body
    checks:
      - kind: object_required_field
        field: title