refactor: move stable store SQL to sqlc#67
Merged
Conversation
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.
Summary
sqlc.yaml, flattened compile-time schema, checked-in generatedinternal/store/storedb, and ascripts/generate-sqlc.shhelper.Storeto generated typed queries and convert stable read/write paths for sync state, status/counts, channels, guilds, members, attachments/media metadata, message upserts/deletes, embedding jobs, and member profile reads.Review Notes
internal/store/sqlc/schema.sqlis a sqlc-only flattened mirror of schema version 3.q.WithTx(tx).Verification
./scripts/generate-sqlc.sh./scripts/generate-sqlc.sh && git diff --exit-code -- internal/store/storedb internal/store/sqlcGOWORK=off go test ./internal/storeGOWORK=off go test ./...DISCRAWL_NO_AUTO_UPDATE=1 GOWORK=off go run ./cmd/discrawl doctorDISCRAWL_NO_AUTO_UPDATE=1 GOWORK=off go run ./cmd/discrawl status --jsonDISCRAWL_NO_AUTO_UPDATE=1 GOWORK=off go run ./cmd/discrawl search --limit 5 testDISCRAWL_NO_AUTO_UPDATE=1 GOWORK=off go run ./cmd/discrawl sync --source wiretap/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --full-access --mode branch --parallel-tests "GOWORK=off go test ./internal/store"