{"_id":"@ashiba-ts/driver-adapter-pg","_rev":"2-e3bf620e26835486bdce276229f67900","name":"@ashiba-ts/driver-adapter-pg","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@ashiba-ts/driver-adapter-pg","version":"0.1.0","license":"MIT","_id":"@ashiba-ts/driver-adapter-pg@0.1.0","maintainers":[{"name":"msugiura","email":"msugiura.npm@gmail.com"}],"dist":{"shasum":"cf0d459e9dd9a391c1be3327d9bb1e361a9da5c6","tarball":"https://registry.npmjs.org/@ashiba-ts/driver-adapter-pg/-/driver-adapter-pg-0.1.0.tgz","fileCount":6,"integrity":"sha512-L6ev+uqVvU3j5QpwAVUFWIetAOOSjaVpjLbzMHVgweuGDhrQZlB5rPuqfzMC4p8NlJt++jX7OTc+jdJg/2C+mw==","signatures":[{"sig":"MEUCIQD/eQtqcDEvMU0iAebLJF3zc4x4GBCjYw+U4O0mIPccsgIgWUap18QdTsW66f1VvtpK4TJaylrY/o5AP0I/oiHkj/E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49773},"main":"dist/index.js","type":"module","_from":"file:ashiba-ts-driver-adapter-pg-0.1.0.tgz","types":"dist/index.d.ts","engines":{"node":">=20"},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","test:live":"vitest run tests/postgres-live.smoke.test.ts","typecheck":"pnpm --filter @ashiba-ts/driver-adapter-core build && tsc --noEmit -p tsconfig.json"},"_npmUser":{"name":"msugiura","email":"msugiura.npm@gmail.com"},"_resolved":"C:\\Users\\mssgm\\AppData\\Local\\Temp\\68b1ef66e62cb795440931da05357409\\ashiba-ts-driver-adapter-pg-0.1.0.tgz","_integrity":"sha512-L6ev+uqVvU3j5QpwAVUFWIetAOOSjaVpjLbzMHVgweuGDhrQZlB5rPuqfzMC4p8NlJt++jX7OTc+jdJg/2C+mw==","_npmVersion":"10.9.2","description":"Thin Ashiba adapter for pg clients.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"@ashiba-ts/driver-adapter-core":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.21.0","@types/pg":"^8.20.0","fast-check":"^4.8.0","@types/node":"^22.13.10"},"peerDependencies":{"pg":">=8"},"peerDependenciesMeta":{"pg":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/driver-adapter-pg_0.1.0_1780036625725_0.6187591988917835","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@ashiba-ts/driver-adapter-pg","version":"0.1.1","description":"Thin Ashiba adapter for pg clients.","repository":{"type":"git","url":"git+https://github.com/mk3008/ashiba.git"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","dependencies":{"@ashiba-ts/driver-adapter-core":"0.1.0"},"peerDependencies":{"pg":">=8"},"peerDependenciesMeta":{"pg":{"optional":true}},"devDependencies":{"@types/node":"^22.13.10","@types/pg":"^8.20.0","fast-check":"^4.8.0","pg":"^8.21.0"},"engines":{"node":">=20"},"license":"MIT","publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"pnpm --filter @ashiba-ts/driver-adapter-core build && tsc --noEmit -p tsconfig.json","test":"vitest run","test:live":"vitest run tests/postgres-live.smoke.test.ts"},"_id":"@ashiba-ts/driver-adapter-pg@0.1.1","bugs":{"url":"https://github.com/mk3008/ashiba/issues"},"homepage":"https://github.com/mk3008/ashiba#readme","_integrity":"sha512-mQ/wj4Lb8Wb/yxbgtNPVIRnnZRlKgPONFcrbtQJI69CUClzxJNCKeadIixmRtcGFli15RtSYjOATpUyT580o9A==","_resolved":"/tmp/51d6bcba0388f32075fe8203bf547a96/ashiba-ts-driver-adapter-pg-0.1.1.tgz","_from":"file:ashiba-ts-driver-adapter-pg-0.1.1.tgz","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-mQ/wj4Lb8Wb/yxbgtNPVIRnnZRlKgPONFcrbtQJI69CUClzxJNCKeadIixmRtcGFli15RtSYjOATpUyT580o9A==","shasum":"e4b6cfb47a70cced9b3e519ae10385c98132bafc","tarball":"https://registry.npmjs.org/@ashiba-ts/driver-adapter-pg/-/driver-adapter-pg-0.1.1.tgz","fileCount":6,"unpackedSize":51205,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@ashiba-ts%2fdriver-adapter-pg@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHp3Tmo3x9Oc5PXNRdtMUqEdq+YBQIZ1Ft+pHoJOJ8W+AiEA0FAtXwEEeAUQ0gqxzUYg2HVt/dfmir5Z+dWZ4Y0Qubw="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:a4ab3db1-7727-4bd6-a3cd-cec5888ec975"}},"directories":{},"maintainers":[{"name":"msugiura","email":"msugiura.npm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/driver-adapter-pg_0.1.1_1780403169192_0.8632553673540637"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-29T06:37:05.520Z","modified":"2026-06-02T12:26:09.767Z","0.1.0":"2026-05-29T06:37:05.881Z","0.1.1":"2026-06-02T12:26:09.417Z"},"license":"MIT","description":"Thin Ashiba adapter for pg clients.","maintainers":[{"name":"msugiura","email":"msugiura.npm@gmail.com"}],"readme":"# @ashiba-ts/driver-adapter-pg\n\nThin Ashiba adapter for [`pg`](https://www.npmjs.com/package/pg) compatible clients.\n\nThis package is the PostgreSQL runtime adapter used by Ashiba-generated\nTypeScript code. It is normally paired with `@ashiba-ts/cli` and\n`@ashiba-ts/testkit-adapter-pg`.\n\nStart with the repository README for the full SQL-first workflow:\n\n- [Ashiba README](https://github.com/mk3008/ashiba#readme)\n- [Command API](https://mk3008.github.io/ashiba/generated/api/commands)\n\n## What This Package Owns\n\nIt owns named parameter binding, parameter contract checks, logger-ready execution events, and safe sort rendering. It does not own transactions, business SQL, ORM behavior, or DDL pull.\n\nApplication code should call the adapter with a file-backed or generated query source object containing SQL text, SQL path, and query model metadata. The adapter still passes a SQL string to the wrapped `pg` client internally, but it does not expose an `execute(sql: string, ...)` convenience boundary for arbitrary runtime SQL input.\n\nThe adapter verifies the source SQL hash and uses CLI-generated Postgres SQL plus ordered parameter names. If metadata is absent or stale, execution fails before the wrapped driver is called.\n\nSafe sort requires CLI-generated query model analysis when sort input is provided. Source SQL stays ordinary SQL without Ashiba-only comments or replacement markers. Runtime AST parsing is intentionally avoided by default. The adapter verifies the source SQL hash, treats query model sortable metadata as the maximum allowed sort surface, and uses query model safe-sort metadata to splice either a new `ORDER BY` clause or an additional comma-separated sort expression at the recorded insertion position. Sort keys must exactly match the query model whitelist; raw ORDER BY fragments, guessed column names, and case-folded matches are rejected. An explicit runtime sort profile may refine default directions, but it cannot replace query model SQL expressions.\n\nRoot compound queries such as `UNION`, `INTERSECT`, and `EXCEPT` are rejected from query model shape metadata instead of being parsed at runtime. The reported next action is to wrap the compound query in an explicit subquery and expose stable sortable columns.\n\nCurrent contract tests cover `pg` compatible query delegation, named parameter binding, unused parameter rejection before driver execution, query-model-gated safe sort rendering, stale metadata rejection, masked/unmasked observer events, and error event emission.\n\nLive PostgreSQL smoke can be run by setting `ASHIBA_TEST_DATABASE_URL` or `DATABASE_URL` before `pnpm test`. Without that environment variable, the live smoke is skipped.\n","readmeFilename":"README.md","homepage":"https://github.com/mk3008/ashiba#readme","repository":{"type":"git","url":"git+https://github.com/mk3008/ashiba.git"},"bugs":{"url":"https://github.com/mk3008/ashiba/issues"}}