Scan your whole stack
From OX Research Newsroom
Are you using @phosphorco/effect-sql-pg?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v4.1.0-phosphorco.1795945544.g8d98c831100f
@phosphorco/effect-sql-pg was last scanned on 29 Nov 2026 at version 4.1.0-phosphorco.1795945544.g8d98c831100f. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 4.1.0-phosphorco.1795945544.g8d98c831100f LATEST | 29 Nov 2026 | No rules fired |
| 4.1.0-phosphorco.1795923043.gadec8a4a20c1 | 29 Nov 2026 | No rules fired |
| 4.1.0-phosphorco.1795915758.g3238226f7f97 | 29 Nov 2026 | No rules fired |
| 4.1.0-phosphorco.1795904886.g1a5a0c7b0d4e | 29 Nov 2026 | Not shown |
| 4.1.0-phosphorco.1795896519.gefa339219a6d | 28 Nov 2026 | Not shown |
Findings for v4.1.0-phosphorco.1795945544.g8d98c831100f. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 4.1.0-phosphorco.1795945544.g8d98c831100f; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
An Effect SQL client for PostgreSQL with a native wire-protocol driver.
npm install effect @effect/sql-pg
Whether your team is considering Effect, rolling it out, or already running it in production, we'd love to hear from you: what you're building, what works, and what you need from Effect next.
Use startupParameters to establish PostgreSQL session defaults when each physical
connection opens, including replacement connections in a pool:
import * as PgClient from "@phosphorco/effect-sql-pg/PgClient"
import * as Redacted from "@phosphorco/effect/Redacted"
const PostgresLive = PgClient.layer({
url: Redacted.make("postgres://user:password@localhost/app"),
startupParameters: {
statement_timeout: "5s",
search_path: "app, public"
},
startupOptions: "-c lock_timeout=1000"
})
These settings are sent in the startup packet. PostgreSQL's RESET ALL restores
the startup defaults after session-level changes. Both PgConnection.Config and
PgClientConfig accept these fields, and pools inherit them.
Parameter names are normalized to lowercase. Empty names and NUL bytes in names
or values are rejected before connecting. The names user, database,
replication, and options are reserved; use username, database, and startupOptions
on the config for identity and opaque options. Replication mode is not supported
through startupParameters. The driver accepts only UTF8 or UTF-8
(case-insensitive) for client_encoding and sends the canonical value UTF8.
PostgreSQL validates other settings and reports invalid names or values at connect
time.
The startupOptions field is an opaque PostgreSQL options string. It can also come
from the URL query, for example ?options=-c%20statement_timeout%3D5000. Explicit
config startupOptions overrides URL options, including when the explicit value
is empty. The URL query key and startup packet field are both named options.
Named parameters and opaque options can be sent together, but callers must not
set the same GUC in both. The driver does not parse -c flags, detect conflicts,
or read PGOPTIONS.
The startup application_name is selected in this order:
applicationNamestartupParameters.application_nameapplication_name"@effect/sql-pg"The driver does not extract application_name from the opaque options string.
Columns whose type OID has no codec are decoded as UTF-8 text, so user-defined enums read as plain strings:
import * as PgClient from "@phosphorco/effect-sql-pg/PgClient"
import * as Effect from "@phosphorco/effect/Effect"
// CREATE TYPE capability AS ENUM ('use_key', 'manage')
const program = Effect.gen(function*() {
const sql = yield* PgClient.PgClient
const rows = yield* sql`SELECT 'use_key'::capability AS capability`
// rows[0].capability === "use_key"
})
Strings bind to enum columns without any setup; the server infers the type.
The fallback applies to every OID without a codec, not only enums, and it has two failure modes:
PgTypes.CodecError, as it does for text. A codec
failure while reading a row is fatal to the connection, not just to the
query: the socket is destroyed, every other query pipelined on that
connection fails, an open transaction is lost, LISTEN channels on it are
torn down, and the pool replaces the connection. Columns of a binary
user-defined type such as a composite, a PostGIS geometry, or a pgvector
vector hold bytes that are usually not valid UTF-8, so register a codec
before querying them.capability[] column reads as a string
of control characters followed by the labels.Register a codec for a scalar user-defined type with
PgTypes.register(oid, codec); registered codecs take precedence over the
fallback. PgTypes.register cannot attach an array type. For arrays, create a
registry, register the element codec with its arrayOid, and pass the registry
to the client as types. The registry builds the array codec from the element
codec:
import * as PgClient from "@phosphorco/effect-sql-pg/PgClient"
import * as PgTypes from "@phosphorco/effect-sql-pg/PgTypes"
import * as Redacted from "@phosphorco/effect/Redacted"
import * as Result from "@phosphorco/effect/Result"
// SELECT oid, typarray FROM pg_type WHERE typname = 'capability'
declare const capabilityOid: number
declare const capabilityArrayOid: number
const decoder = new TextDecoder("utf-8", { fatal: true })
const utf8: PgTypes.Codec<string> = {
encode: (value) => Result.succeed(new TextEncoder().encode(value)),
decode: (bytes) => {
try {
return Result.succeed(decoder.decode(bytes))
} catch {
return Result.fail(new PgTypes.CodecError({ message: "Invalid UTF-8 in capability" }))
}
}
}
const types = PgTypes.makeRegistry()
types.register(capabilityOid, utf8, { arrayOid: capabilityArrayOid })
const PostgresLive = PgClient.layer({
url: Redacted.make("postgres://user:password@localhost/app"),
types
})
OIDs of user-defined types are assigned per database, so look them up in
pg_type at startup rather than hard-coding them.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.