Repository navigation
chore: delete sqlc + dbmate filesystem and Nix references - #1220
Merged
Merged
Conversation
|
Related Knowledge 1 document with suggested updates is ready for review. kalbasit's Space Development Environment with MinIOView Suggested Changes@@ -37,24 +37,10 @@
[See initialization script](https://github.com/kalbasit/ncps/blob/cf8e19f/nix/process-compose/init-minio.sh)
-# Database Migration Transaction Handling
-**IMPORTANT:** Do NOT manually add `BEGIN`/`COMMIT` blocks to your migration files. The `dbmate` tool automatically wraps each migration in a transaction for atomicity. Adding manual transaction blocks will cause errors such as "cannot start a transaction within a transaction."
+# Database Migrations
+The project uses Ent with Atlas for database migrations. Migration files are generated and located at `migrations/<dialect>/` (where `<dialect>` is `sqlite`, `postgres`, or `mysql`). These files are generated by Ent's migrate codegen combined with Atlas.
-**Example:**
-
-```sql
--- ❌ WRONG - Don't add manual transactions
--- migrate:up
-BEGIN;
-CREATE TABLE example (...);
-COMMIT;
-
--- ✅ CORRECT - Let dbmate handle transactions
--- migrate:up
-CREATE TABLE example (...);
-```
-
-Letting dbmate manage transactions ensures that if any part of a migration fails, the entire migration is rolled back, preventing partial or inconsistent database states.
+Atlas automatically handles transaction wrapping for migrations where appropriate. Do not manually add `BEGIN`/`COMMIT` blocks to migration files unless you have a specific requirement that needs explicit transaction control.
## Running MinIO and Initialization
Start MinIO and run the initialization process using: |
This was referenced May 21, 2026
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 00:36
3574d14 to
61d7585
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 00:36
4d61334 to
82a1c60
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 03:31
61d7585 to
1f076fa
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 03:31
82a1c60 to
d8c802e
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 03:45
1f076fa to
5d4c343
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 03:45
d8c802e to
0a54b7f
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 03:58
5d4c343 to
e484ce8
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 03:58
0a54b7f to
5784cf8
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 04:10
e484ce8 to
4154841
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 04:10
5784cf8 to
0b7fb67
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 04:22
4154841 to
a6c8063
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 04:22
0b7fb67 to
9a83354
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 04:34
a6c8063 to
5ddb281
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 04:34
9a83354 to
7365aac
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
kalbasit
force-pushed
the
docs-openspec-mark-11-and-12-done
branch
from
May 23, 2026 04:47
5ddb281 to
5f1242a
Compare
kalbasit
force-pushed
the
chore-delete-sqlc-dbmate-filesystem-and-nix
branch
from
May 23, 2026 04:47
7365aac to
011281b
Compare
kalbasit
added a commit
that referenced
this pull request
May 23, 2026
The parent commit deletes the sqlc-generated query.<dialect>.sql.go trees, shrinking the limited (ncps) fileset's vendor down to the ent-only set. But the golangci-lint-check check that overrides ncps with `src = ../../.` still sees `cmd/generate-migrations`, which transitively pulls in modernc.org/sqlite — a dep the shrunken limited fileset no longer needs. The two derivations end up wanting different vendorHashes for the same attribute. Bring `cmd/` into the ncps limited fileset so both derivations share the same vendor and the single vendorHash satisfies both. The exclude in #1220's source-list cleanup becomes a no-op for cmd/ but still removes db/migrations and db/schema cleanly.
§12.1-12.3, §12.6-12.9 of the migrate-to-ent-and-atlas change.
With the Go-side cleanup complete and tests fully on Ent, drop the
last vestiges of the old toolchain from disk:
* db/query.{sqlite,postgres,mysql}.sql (sqlc input)
* db/schema/{sqlite,postgres,mysql}.sql (sqlc-generated schema dumps)
* db/migrations/{sqlite,postgres,mysql}/ (dbmate-era migrations;
the authoritative copies now live at migrations/<dialect>/ via
ent/migrate codegen + Atlas)
* sqlc.yml at repo root
* nix/dbmate-wrapper/ + its flake-module import in flake.nix
* dbmate command in nix/devshells/flake-module.nix
* dbmate from nix/packages/ncps/default.nix nativeBuildInputs
* dbmate-wrapper layer + NCPS_DB_MIGRATIONS_DIR/DBMATE_* env in
nix/packages/docker{,dev}.nix
* nix/dbmate-wrapper/src golangci-lint exclude in pre-commit/
* github.com/kalbasit/sqlc-multi-db from the go.mod tool() and
indirect requires (go mod tidy ran)
Nix source bundle (nix/packages/ncps/default.nix) is updated to
include the new repo-root migrations/ + ent/ + cmd/ + internal/
dirs in place of db/. nix flake check passes; go build + go vet +
go test -race -count=1 across SQLite + Postgres + MySQL + MinIO +
Redis is green across all 29 packages.
Tasks.md is updated to mark §12.1-12.3, §12.6-12.9 complete.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
After dropping sqlc-multi-db from go.mod in the parent cleanup commit, two transitive deps it pulled in are now orphaned: - mvdan.cc/gofumpt (indirect) - github.com/go-quicktest/qt (indirect, h1: entries only) `go mod tidy` prunes them, and the new vendor set produces a new fixed-output hash. Refresh vendorHash in nix/packages/ncps/ default.nix so `nix build .#ncps.goModules` (CI's vendor-hash gate) stays green at this branch and every branch above it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1220 +/- ##
=====================================
Coverage 5.50% 5.50%
=====================================
Files 6 6
Lines 400 400
=====================================
Hits 22 22
Misses 374 374
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
Author
|
Automated stack merge failed during the rebase step. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
§12.1-12.3, §12.6-12.9 of the migrate-to-ent-and-atlas change.
With the Go-side cleanup complete and tests fully on Ent, drop the
last vestiges of the old toolchain from disk:
the authoritative copies now live at migrations// via
ent/migrate codegen + Atlas)
nix/packages/docker{,dev}.nix
indirect requires (go mod tidy ran)
Nix source bundle (nix/packages/ncps/default.nix) is updated to
include the new repo-root migrations/ + ent/ + cmd/ + internal/
dirs in place of db/. nix flake check passes; go build + go vet +
go test -race -count=1 across SQLite + Postgres + MySQL + MinIO +
Redis is green across all 29 packages.
Tasks.md is updated to mark §12.1-12.3, §12.6-12.9 complete.
Co-Authored-By: Claude Opus 4.7 [email protected]