Skip to content

Migrate from supabase to generic postgres db#8

Merged
smutyala1at merged 24 commits into
mainfrom
feat/generic-postgres
Feb 4, 2026
Merged

Migrate from supabase to generic postgres db#8
smutyala1at merged 24 commits into
mainfrom
feat/generic-postgres

Conversation

@smutyala1at
Copy link
Copy Markdown
Collaborator

No description provided.

- Add pg, @types/pg for PostgreSQL client
- Add prisma, @prisma/client for schema management
- Add @prisma/adapter-pg for Prisma 7 support
- Create prisma/schema.prisma with PostgreSQL provider
- Define docs table schema matching existing structure
- Use Unsupported type for pgvector vector(3072) column
- Configure indexes and constraints
- Rename SupabaseConfig to DatabaseConfig
- Update fields: databaseUrl, table, keep search config
- Update AppConfig to use database instead of supabase
- Create database/types.ts with interfaces and types
- Export ExistingChunkInfo, PostgresDocRow, RetrievedChunk
- Define types for database operations
- Create database/prisma.ts for Prisma client initialization
- Use @prisma/adapter-pg with pg.Pool for Prisma 7
- Create utils/getDatabaseUrl.ts for shared URL resolution
- Support MIMIR_DATABASE_URL and DATABASE_URL
- Create database/client.ts with PostgresVectorStore class
- Implement constructor, connection pool setup, verifyConnection()
- Use pg.Pool for PostgreSQL connections
- Replace Supabase client with direct PostgreSQL connection
- Create database/chunks.ts with chunk operations
- Implement fetchExistingChunks, fetchChunksByChecksums
- Implement upsertChunks, deleteChunksByIds, updateChunkOrders
- Use parameterized SQL queries for safety
- Create database/moves.ts with moveChunksAtomic method
- Handle two-phase atomic moves with temporary filepaths
- Prevent unique constraint violations during moves
- Create database/orphans.ts with orphan detection methods
- Implement findOrphanedChunkIds, findStrandedChunkIds
- Handle batch fetching and repository scoping
- Create database/search.ts with search methods
- Implement matchDocuments using match_docs SQL function
- Implement searchDocumentsFullText using match_docs_bm25
- Format embeddings as PostgreSQL array strings
- Create database/index.ts to export all modules
- Re-export types, client, and all operation modules
- Provide clean public API for database operations
- Create initial migration with vector extension
- Create docs table with all columns and indexes
- Add match_docs and match_docs_bm25 SQL functions
- Add updated_at trigger
- Create prisma.config.ts for Prisma 7 datasource URL
- Use shared getDatabaseUrl utility
- Configure schema and migrations paths
- Update loadConfig.ts to use MIMIR_DATABASE_URL
- Remove Supabase-specific environment variables
- Update all config.supabase references to config.database
- Update server.ts to use createPostgresStore
- Update context.ts to use PostgresVectorStore type
- Update all route handlers to use new store
- Replace SupabaseVectorStore with PostgresVectorStore
- Update askAi.ts to use PostgresVectorStore
- Update config references from supabase to database
- Update pipeline.ts to use PostgresVectorStore
- Update ingest CLI and route handlers
- Update all type references
- Update Makefile to use Prisma migrations instead of direct SQL
- Update docker-entrypoint.sh to use Prisma migrate deploy
- Remove Supabase-specific connection string construction
- Support MIMIR_DATABASE_URL and DATABASE_URL
- Update README.md with PostgreSQL setup instructions
- Update configuration.mdx to remove Supabase references
- Add database configuration options (BM25, hybrid search)
- Update getting-started and deployment docs
- Clarify single vs multiple repo configuration
- Remove obvious comments that restate what code does
- Keep only essential documentation and non-obvious logic comments
- Clean up code for better readability
- Remove Supabase-specific variables
- Use MIMIR_DATABASE_URL for generic PostgreSQL
- Update all configuration examples
- Add all single and multiple repo configuration options
- Include all optional LLM and database settings
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mimir Ready Ready Preview, Comment Feb 4, 2026 10:23am

Request Review

@smutyala1at smutyala1at merged commit 9bb5e84 into main Feb 4, 2026
2 checks passed
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.

1 participant