Created
December 6, 2024 03:48
-
-
Save wasdee/6946d68fb3b2db1cc92202dfb0acb24c to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# mise description="Generate the DB schema for the AI Contexts" | |
set -euo pipefail | |
cd "$(git rev-parse --show-toplevel)" | |
mkdir -p ./AIContexts/ | |
docker run --rm -v "$PWD/AIContexts:/data" postgres:15 \ | |
pg_dump $POSTGRES_URL -s -O -x -n public -t public.* -f /data/db_schema.sql | |
echo "Please follow up by asking ai (Cursor Long Context Chat) to create compressed version of the db schema | |
Rewrite this DB schema for AI context: | |
- Shorten it by incorporating foreign keys, indexes, primary keys, and unique constraints directly into CREATE TABLE statements. | |
- Remove views, `SET` statements, and `create policy` statements. | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment