MCPcopy Create free account
hub / github.com/effect-app/libs / pgConstraintFromCause

Function pgConstraintFromCause

repos/effect/packages/sql/pg/src/PgClient.ts:898–908  ·  view source on GitHub ↗
(cause: unknown)

Source from the content-addressed store, hash-verified

896 * @category constructors
897 * @since 4.0.0
898 */
899const PgJson = Statement.custom<PgJson>("PgJson")
900
901const ATTR_DB_SYSTEM_NAME = "db.system.name"
902const ATTR_DB_NAMESPACE = "db.namespace"
903const ATTR_SERVER_ADDRESS = "server.address"
904const ATTR_SERVER_PORT = "server.port"
905
906const pgCodeFromCause = (cause: unknown): string | undefined => {
907 if (typeof cause !== "object" || cause === null || !("code" in cause)) {
908 return undefined
909 }
910 const code = cause.code
911 return typeof code === "string" ? code : undefined

Callers 1

classifyErrorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…