shipwithjev

Catalog / Tools & apps

0482GitHub

jevql

Psql-shaped client and Go/TypeScript/Python SDKs for vanilla PostgreSQL where Jev makes Noul, Choice, and Score judgements about individual table rows after the plain SQL has run…

kylemclaren/jevqlREADME ↗
# jevQL

Semantic SQL for **vanilla PostgreSQL**. One extra family of functions, `jev()`, works in any query, from the CLI, from a shared HTTP and MCP node, or from the Go, TypeScript and Python SDKs.

```sql
SELECT name, city, jev_prob(people, 'could work from home') AS p
FROM people
WHERE jev(people, 'could work from home')
  AND country = 'PT'
ORDER BY p DESC
LIMIT 20;
```

The database only ever sees ordinary SQL. `jev_*` calls are evaluated by the
CLI using [TypeSafe](https://typesafe.ai)'s System One model (Jev). No
`CREATE EXTENSION`, no superuser, no wire-protocol proxy.

## Install

Homebrew (macOS and Linux):

```bash
brew install kylemclaren/tap/jevql
```

Prebuilt binaries for macOS and Linux (arm64 and amd64) are attached to each
[GitHub release](https://github.com/kylemclaren/jevql/releases) as
`jevql_<version>_<os>_<arch>.tar.gz` with a `checksums.txt`.

From source, with Go 1.23+ and a C compiler (libpg_query is bundled via
[`pg_query_go`](https://github.com/pganalyze/pg_query_go) and needs CGO):

```bash
CGO_ENABLED=1 go install github.com/kylemclaren/jevql/cmd/jevql@latest
```

The first build compiles libpg_query and takes about a minute. On macOS,
`xcode-select --install` provides the compiler. If the build complains about
CGO, make sure `CGO_ENABLED=1` is set and that `cc` is on your `PATH`.

## Use

```bash
export TYPESAFE_API_KEY=tsk_...
export DATABASE_URL=postgres://user:pass@localhost:5432/app

jevql                                  # REPL
jevql -c "SELECT * FROM people WHERE jev(people, 'could work from home')"
jevql -f query.sql
jevql --explain -c "..."               # plan + cost estimate, no API calls
jevql "postgres://..." -c "SELECT 1"   # plain statements pass straight through
```

Run `jevql` with nothing configured and it asks for a da

Also filed under Tools & apps