Files
pentagi/backend/sqlc/sqlc.yml
T
Dmitry Ng 3a52079278 feat(knowledge): add pgvector knowledge base management
- GraphQL/REST CRUD + semantic search for knowledge documents
- KnowledgeStore with admin/user-scoped filtering, re-embedding on update
- Real-time subscriptions (created/updated/deleted) per user and admin
- user_id tracking in all agent-stored documents (guide/answer/code/memory)
- sqlc queries, goose migrations, privilege grants, user_id backfill
- Memory cleanup on flow deletion; stale orphan purge via migration
- Unit tests for all KnowledgeStore operations including security cases
- Frontend GraphQL schema and TypeScript types regenerated
2026-05-05 01:09:20 +03:00

38 lines
1.2 KiB
YAML

# SQLC configuration for PentAGI database layer code generation
# Generates type-safe Go code from SQL queries and PostgreSQL schema
version: "2"
cloud:
sql:
- engine: "postgresql"
queries: ["models/*.sql"]
schema: ["../migrations/sql/*.sql"]
# Go code generation settings
gen:
go:
package: "database"
out: "../pkg/database"
sql_package: "database/sql"
emit_interface: true # Generate Querier interface for mocking
emit_json_tags: true # Add JSON tags to generated structs
# PostgreSQL to Go type mappings
overrides:
- db_type: "pg_catalog.numeric"
go_type: "float64"
- db_type: "bigint"
go_type: "int64"
# pgvector extension type — never selected in queries, but sqlc needs a mapping
# to generate the LangchainPgEmbedding model struct in models.go.
- db_type: "pg_catalog.vector"
go_type: "string"
nullable: true
- db_type: "vector"
go_type: "string"
nullable: true
# Database connection for sqlc analysis
database:
uri: ${DATABASE_URL}