{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "sheltercosmo-jev4pg--semantic-sql-from-psql",
 "repo": "Sheltercosmo/jev4pg",
 "repo_url": "https://github.com/Sheltercosmo/jev4pg",
 "repo_slug": "sheltercosmo-jev4pg",
 "title": "Query semantic conditions directly from psql with native functions",
 "page_title": "How to query semantic conditions directly from psql with native functions with Jev4 PG",
 "summary": "Call jev_native functions from any PostgreSQL client against tables you already own.",
 "who": "A data engineer on a Linux PostgreSQL 17 server who wants semantic filters inside SQL clients without running a Python service.",
 "problem": "Teams that work only in SQL editors have no way to add semantic judgments without a separate application layer.",
 "outcome": "A SQL query that uses jev_native.scan to group and count rows by semantic judgment, with PostgreSQL handling the grouping.",
 "steps": [
  "Run `git clone --branch v0.7.0 https://github.com/Sheltercosmo/jev4pg.git` and then `cd jev4pg`.",
  "Follow the [build and install the extension files](native/README.md#build) instructions, and configure the provider through `JEV_NATIVE_CONFIG_FILE` in the PostgreSQL server environment.",
  "In your target database, run `CREATE EXTENSION jev_native;`.",
  "As an administrator, run `GRANT USAGE ON SCHEMA jev_native, business TO analyst;`, `GRANT EXECUTE ON FUNCTION jev_native.scan(text,jsonb,jsonb) TO analyst;` and `GRANT SELECT ON business.tickets TO analyst;`.",
  "Connect with psql as `analyst` and run a SELECT that calls `jev_native.scan` on `business.tickets`, grouping the results by product."
 ],
 "agent_prompt": "Use the jev4pg repository to install the jev_native extension on a PostgreSQL 17 server and grant access to a SQL login named <login> for the table <schema>.<table>. Return a grouped query over jev_native.scan and confirm that the result includes decision states and uncertainty for each row.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "3 hours",
 "basis": "readme",
 "caveat": "The native extension is a 0.2.0 preview, and the README lists native maintained-feature refresh and semantic write review as roadmap items that are not yet available.",
 "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": [
  {
   "tag": "credentials",
   "notice": "The provider key and the SQL logins for analysts are configured on the database server, so restrict who can read the server environment and the configuration file."
  }
 ],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/sheltercosmo-jev4pg/semantic-sql-from-psql/",
 "md": "https://dedupedai.com/use-cases/sheltercosmo-jev4pg/semantic-sql-from-psql/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--semantic-sql-from-psql.json",
 "api_version": "v1"
}
