mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
- migrations/postgres/: consolidated pg schema with tsvector FTS, CITEXT usernames, native CHECK constraints, native BOOLEAN/TIMESTAMPTZ types - db/queries/postgres/: 14 sqlc query files dialect-translated from sqlite ($N placeholders, NOW(), TRUE/FALSE, ON CONFLICT DO UPDATE, RETURNING id, :execrows for mutations needing row count) - sqlc.yaml: second engine entry -> pgdbgen package under pgx/v5 - Makefile: sqlc-verify covers both dbgen + pgdbgen - store/postgres.go: PostgresStore behind //go:build postgres, full Store interface (112 methods). Connection lifecycle real; query methods stub ErrPostgresNotImplemented awaiting pgdbgen wrappers - config: DatabaseConfig.Type/Host/Port/User/Password/Name/SSLMode/MaxConns - main.go: explicit dispatch on database.type; postgres errors with clear pointer at remaining work until pgdbgen + boundary refactor land - phase-a-foundation.md: implementation status + actionable TODO checklist including forward-only sqlite->postgres data migration design
24 lines
732 B
Makefile
24 lines
732 B
Makefile
# OwnCord Server — developer convenience targets
|
|
#
|
|
# sqlc-generate Regenerate type-safe Go for both the sqlite and postgres
|
|
# engines defined in sqlc.yaml (db/dbgen + db/pgdbgen).
|
|
# sqlc-verify Fail if either committed dbgen output is stale (used by CI).
|
|
# sqlc-install Install the pinned sqlc version into $GOBIN.
|
|
|
|
SQLC_VERSION := $(shell cat sqlc.version)
|
|
|
|
.PHONY: sqlc-install sqlc-generate sqlc-verify
|
|
|
|
sqlc-install:
|
|
go install github.com/sqlc-dev/sqlc/cmd/sqlc@$(SQLC_VERSION)
|
|
|
|
sqlc-generate:
|
|
sqlc generate
|
|
|
|
sqlc-verify:
|
|
sqlc generate
|
|
@git diff --exit-code db/dbgen db/pgdbgen || ( \
|
|
echo "ERROR: generated sqlc output is stale. Run 'make sqlc-generate' and commit the result." ; \
|
|
exit 1 ; \
|
|
)
|