{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "sheltercosmo-jev4pg--analyze-existing-postgres-tables",
 "repo": "Sheltercosmo/jev4pg",
 "repo_url": "https://github.com/Sheltercosmo/jev4pg",
 "repo_slug": "sheltercosmo-jev4pg",
 "title": "Run semantic analysis on existing PostgreSQL tables in place",
 "page_title": "How to run semantic analysis on existing PostgreSQL tables in place with Jev4 PG",
 "summary": "Attach a table you already run without copying its rows, then query it with JEV from the workspace.",
 "who": "A database administrator who already operates a PostgreSQL 17 database and must let analysts query business tables without moving data.",
 "problem": "Copying business tables into a new store creates duplicate data and new permission risks.",
 "outcome": "A registered table that the workspace reads in place, with PostgreSQL grants and row-security policies deciding what each query can see.",
 "steps": [
  "Run `git clone --branch v0.7.0 https://github.com/Sheltercosmo/jev4pg.git` and then `cd jev4pg`, then `python deploy/configure.py`.",
  "Copy `deploy/external.env.example` to `deployment.env` and set your host, port, database and login names. Back up the target database before migration.",
  "Run `docker compose --env-file deployment.env -f compose.external.yaml build app`, then `docker compose --env-file deployment.env -f compose.external.yaml run --rm migrate migrate --check`, then `docker compose --env-file deployment.env -f compose.external.yaml run --rm migrate`.",
  "As the table owner or an administrator, grant `GRANT USAGE ON SCHEMA business TO semantic_runtime;` and `GRANT SELECT ON business.tickets TO semantic_runtime;`.",
  "Run `docker compose --env-file deployment.env -f compose.external.yaml exec app jev4pg attach tickets --tenant demo --schema business --table tickets`, then run `docker compose --env-file deployment.env -f compose.external.yaml --profile queries up -d --wait`."
 ],
 "agent_prompt": "Use the jev4pg repository to attach the existing table <schema>.<table> to the workspace for tenant demo without copying rows, using the external PostgreSQL setup. Report the grants that were applied and confirm that a test SELECT through the workspace returns only rows visible to the runtime login.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README says to back up the target database before migration and that generated passwords do not change existing logins, so review each grant before running it.",
 "category": "Data and analytics",
 "tags": [
  "Data and analytics"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.11+ and Docker with Compose v2",
  "A TypeSafe key or other JEV provider settings",
  "A CSV export or an existing PostgreSQL table to query"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/sheltercosmo-jev4pg/analyze-existing-postgres-tables/",
 "md": "https://dedupedai.com/use-cases/sheltercosmo-jev4pg/analyze-existing-postgres-tables/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/sheltercosmo-jev4pg--analyze-existing-postgres-tables.json",
 "api_version": "v1"
}
