Skip to content

.sql files not indexed by gbrain sync walker #1173

@abolnasr

Description

@abolnasr

The v0.32 gbrain sync walker has no .sql extension
in its handled-files list. Projects with SQL migration
corpora (Knex migrations, sqitch, Postgres *.sql
schema files, etc.) get the migrations SKIPPED from the
gbrain index entirely.

For tools that consume gbrain to reason about schema
state, this is a surprise: the migrations are visible
on disk but invisible to queries.

Workaround (when the consumer doesn't strictly
need gbrain to index migrations): consume migrations
directly off disk. Superstack's schema-tracker v2
contract went this route — the contract reads
migrations/*.sql directly without relying on gbrain.
The trade-off is duplicated disk-walk logic in every
consumer.

Expected: .sql files are indexed by the walker.
Either:

  • Register a SQL chunker (tree-sitter grammar) so the
    files chunk semantically (one statement per chunk),
    OR
  • Index .sql files as plaintext when no chunker is
    registered (the same fallback strategy used for
    un-grammared extensions).

Reproduction:

mkdir /tmp/sql-demo && cd /tmp/sql-demo
git init -q
mkdir migrations
echo "CREATE TABLE users (id SERIAL PRIMARY KEY, email TEXT);" > migrations/001_users.sql
git add -A && git commit -qm init
gbrain sources add sql-demo --path .
gbrain sync --source sql-demo --strategy auto
gbrain list --source sql-demo
# observed: zero SQL pages in the list

Severity: medium for projects with SQL migration
corpora; low for projects that don't use SQL or that
consume migrations directly from disk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions