# DuckDB Community Extensions descriptor for `mentat`.
#
# This is the file that registers `mentat_duckdb` with the DuckDB Community
# Extensions registry (https://github.com/duckdb/community-extensions): the
# FIRST submission is a manual, human-reviewed PR that adds this file (as
# `extensions/mentat/description.yml`) to that repo. Subsequent version bumps
# are opened automatically by `.github/workflows/release.yml` (job
# `duckdb-registry-pr`), which rewrites `extension.version` + `repo.ref` and
# opens a PR to the upstream repo — the merge there is a human gate.
#
# Their CI builds and signs the extension centrally, cloning `repo.github` at
# `repo.ref` and building against DuckDB v1.5.6 (which is exactly what this
# extension is pinned to). See docs/registry-publishing.md.
extension:
  name: mentat
  description: Datomic-compatible Datalog query engine as a DuckDB extension
  version: 1.11.1
  language: Rust
  build: cargo
  license: Apache-2.0
  maintainers:
    - gburd
  requires_toolchains: "rust;python3"
  # Not yet built or tested for musl/mingw/wasm; relax these once cross-builds
  # are proven.
  excluded_platforms: "wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw;linux_amd64_musl"
repo:
  # Their CI clones from GitHub, so this points at the mirror, not Codeberg.
  github: gburd/mentat
  # A commit SHA (release.yml fills the tag's SHA in the automated bump PR).
  ref: PLACEHOLDER_SHA
docs:
  hello_world: |
    LOAD mentat;
    -- Transact a schema and data into the mentat store 'default'. Its datoms are
    -- DuckDB tables (schema `mentat`) in the database you have open.
    SELECT edn_t('default',
      '[{:db/ident :person/name :db/valueType :db.type/string :db/cardinality :db.cardinality/one}]');
    SELECT edn_t('default', '[{:person/name "Alice"} {:person/name "Bob"}]');
    -- Datalog: a table function, so the rows join against your own tables.
    SELECT * FROM edn_q('default',
      '[:find ?e ?name :where [?e :person/name ?name]]', '{}');
    SELECT * FROM edn_q('default',
      '[:find ?e . :in ?name :where [?e :person/name ?name]]', '{"inputs": ["Alice"]}');
    -- The datoms are plain DuckDB rows.
    SELECT count(*) FROM mentat.datoms;
  extended_description: |
    mentat is a Datomic-compatible database: an EDN/Datalog front-end over an
    entity-attribute-value store with history. This extension stores mentat's
    datoms in DuckDB: each mentat store is a schema of ordinary tables in the
    database the extension is loaded into, so the data persists with that
    database and plain SQL can read it. It exposes `edn_t` (transact), `edn_q`
    (Datalog query table function, with :in inputs and asOf/since), `edn_pull`
    (pull pattern -> JSON) and `edn_eval` (sandboxed mino script), so Datalog
    query results can be joined against native DuckDB tables. The same engine is also
    available as an embedded Rust library and CLI (on SQLite) and a PostgreSQL
    extension (`pg_mentat`). Source: https://codeberg.org/gregburd/mentat
