Skip to content

pg_typesafe

Pre-alpha PostgreSQL C extension calling Jev from SQL for Choice, Noul, Score and batched judgments, with EXECUTE revoked by default.

PluginprototypeMIT

Overview

pg_typesafe is a pre-alpha PostgreSQL extension that calls TypeSafe's System One API (Jev) from SQL for categorical work: Choice, Noul and Score, plus batched judgments per the list summary. It supports PostgreSQL 15 to 18 on Linux and macOS with libcurl 7.61+, and is not affiliated with TypeSafe or the PostgreSQL Global Development Group.

A one-line installer finds every PostgreSQL 15+ server, installs a checksum-verified prebuilt binary or builds from source, installs build dependencies, and can enable the extension in a database and pass the API key over COPY so it never appears in statement text or logs. Docker images based on the official postgres image ship with the extension preinstalled and support keys via secrets. A list summary notes EXECUTE is revoked from PUBLIC by default, so access must be granted deliberately. It is MIT licensed with CI and PGXN distribution.

What the decision model decides

TypeQuestionAnswers
ChoiceWhich category does this value belong to?—
Yes / noIs this statement true of the value?yes · no
ScoreScore the value on ordered levels—

How it works

  1. Install with the script or Docker image.
  2. CREATE EXTENSION and grant EXECUTE to chosen roles.
  3. Call Choice, Noul or Score functions in SQL.
  4. Use batched judgments for many rows.

Strengths

  • Careful key handling.
  • Prebuilt binaries and Docker images.
  • Secure-by-default permissions.

Caveats

  • Pre-alpha.
  • Each judgment calls the hosted API.

Getting started

curl -fsSL https://raw.githubusercontent.com/giuliosmall/pg_typesafe/main/install.sh | sh, or docker run ghcr.io/giuliosmall/pg_typesafe:17 with TYPESAFE_API_KEY.

At a glance

Type
Plugin
Status
prototype
Language
C
Runtime
PostgreSQL extension, Docker
Has code
yes
Has tests
yes
License
MIT

Use cases and integrations

How curated lists describe it

  • A pre-alpha PostgreSQL C extension for calling Jev from SQL for classification, yes/no judgments, and scoring.

    logicrw/awesome-jev-projects
  • Pre-alpha PostgreSQL extension for TypeSafe AI (Jev) categorical classification.

    wh000wh000/awesome-jev-live
  • Pre-alpha PostgreSQL C extension exposing Choice, Noul, Score, and batched judgments from SQL.

    cobanov/awesome-jev
  • Pre-alpha PostgreSQL extension for TypeSafe AI (Jev) categorical classification.

    hellogumbo/awesome-jev
  • Pre-alpha PostgreSQL extension that calls Jev from SQL for Choice, Noul, and Score, with `EXECUTE` revoked from `PUBLIC` by default.

    MrJev/awesome-jev

Frequently asked questions

Which PostgreSQL versions are supported?

15, 16, 17 and 18.

Who can call the functions?

EXECUTE is revoked from PUBLIC by default; grant it to specific roles.

How is the API key protected?

It is passed via COPY and stored in a key file, never in statement text or logs.

Related projects

  • dbt package and Terraform module adding jev_noul, jev_choice, jev_score and jev_ask SQL functions to Snowflake.

    LibrarybetaSQL
  • Portable SQLite C extension depending only on libcurl that adds jev_noul, jev_choice and jev_score SQL functions.

    PluginbetaC
  • DuckDB extension and Python package for semantic SQL that batches row-level filters, joins and classification on Jev.

    PluginresearchC++
  • High-throughput native DuckDB extension that batches and streams Jev Noul, Choice and Score judgments directly from SQL.

    PluginbetaC++
  • PostgreSQL extension with jev(), jev_prob, jev_choice and jev_score to filter, rank and classify rows by plain-language conditions.

    PluginbetaC
  • SQLite loadable extension and Python package exposing Jev Noul, Choice and Score as SQL functions and batched virtual-table scans.

    PluginbetaC