Source Code: https://github.com/olirice/genai-pg-context
genai-pg-context develops a single SQL query context.sql that can be used to extract "context" for Generative AI tools from a Postgres database for example v0, bolt and lovable. A better long term solution would include pagination, partial fetches, and globally unique cacheable ids for all entities.
See context.sql for the context query (remove the function wrapper)
Supabase PostgreSQL 15+
Setup:
git clone https://github.com/olirice/genai-pg-context.git
cd genai-pg-context
Ensure postgres is on your path.
To run the test suite:
./bin/installcheck