Skip to content

Move index database into .dexter/ folder - #46

Merged
JesseHerrick merged 10 commits into
mainfrom
move-db-to-dexter-folder
Apr 22, 2026
Merged

Move index database into .dexter/ folder#46
JesseHerrick merged 10 commits into
mainfrom
move-db-to-dexter-folder

Conversation

@JesseHerrick

@JesseHerrick JesseHerrick commented Apr 22, 2026

Copy link
Copy Markdown
Member

Continuation of #10. I couldn't push to @egze's PR since he made it on a fork, but I needed to add the .gitignore change and README updates.

Summary from #10:

  • Moves the SQLite index from /.dexter.db to /.dexter/dexter.db so the repo root stays clean and future dexter artifacts have a dedicated scratch space.
  • Existing databases migrate automatically on the next dexter init or LSP startup: legacy .dexter.db and its -shm/-wal siblings are deleted and a fresh index is built in the new folder. No user action required beyond updating their own .gitignore.
  • All path knowledge is centralized in internal/store via new DBPath, DBDir, LegacyDBPath, and FindProjectRoot helpers. The duplicated root-marker walks in cmd/main.go and internal/lsp/server.go are gone; the LSP call sites now have an inline comment documenting why they intentionally don't pass mix.exs as an extra marker.
  • Editor-extension repos (dexter-vscode, dexter-zed) continue to work via their existing mix.exs/.git fallback markers and can be updated separately.

Note

Medium Risk
Moderate risk because it changes index location/root-detection used by both CLI and LSP and adds automatic deletion-based migration of legacy DB files, which could impact existing setups if path resolution is wrong.

Overview
Dexter now stores its index at .dexter/dexter.db instead of .dexter.db, creating the .dexter/ directory on open and writing a local .gitignore so projects no longer need to ignore DB artifacts manually.

Path/root resolution is centralized in internal/store via DBPath/DBDir/LegacyDBPath and FindProjectRoot; the CLI and LSP switch to these helpers (with the LSP intentionally not falling back to mix.exs to keep monorepo roots anchored on .dexter/ or .git).

On startup, store.Open now auto-migrates by deleting any legacy .dexter.db + WAL/SHM siblings and rebuilding in the new location; integration/unit tests and README/editor configs are updated accordingly.

Reviewed by Cursor Bugbot for commit 1957ea7. Bugbot is set up for automated code reviews on this repo. Configure here.

@JesseHerrick JesseHerrick self-assigned this Apr 22, 2026
@JesseHerrick
JesseHerrick merged commit 72d1a87 into main Apr 22, 2026
5 checks passed
@JesseHerrick
JesseHerrick deleted the move-db-to-dexter-folder branch April 22, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants