@homeflare/alchemy 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/README.md +25 -1
  2. package/dist/litellm/client.d.ts +76 -0
  3. package/dist/litellm/client.d.ts.map +1 -0
  4. package/dist/litellm/credentials.d.ts +48 -0
  5. package/dist/litellm/credentials.d.ts.map +1 -0
  6. package/dist/litellm/fake-litellm.d.ts +36 -0
  7. package/dist/litellm/fake-litellm.d.ts.map +1 -0
  8. package/dist/litellm/fake-stack.d.ts +30 -0
  9. package/dist/litellm/fake-stack.d.ts.map +1 -0
  10. package/dist/litellm/generated/pass-through.d.ts +71 -0
  11. package/dist/litellm/generated/pass-through.d.ts.map +1 -0
  12. package/dist/litellm/index.d.ts +13 -0
  13. package/dist/litellm/index.d.ts.map +1 -0
  14. package/dist/litellm/index.js +270 -0
  15. package/dist/litellm/index.js.map +14 -0
  16. package/dist/litellm/pass-through-endpoint.d.ts +94 -0
  17. package/dist/litellm/pass-through-endpoint.d.ts.map +1 -0
  18. package/dist/litellm/pass-through-form.d.ts +40 -0
  19. package/dist/litellm/pass-through-form.d.ts.map +1 -0
  20. package/dist/litellm/providers.d.ts +16 -0
  21. package/dist/litellm/providers.d.ts.map +1 -0
  22. package/dist/paperless/client.d.ts +37 -0
  23. package/dist/paperless/client.d.ts.map +1 -0
  24. package/dist/paperless/constraint-guard.d.ts +19 -0
  25. package/dist/paperless/constraint-guard.d.ts.map +1 -0
  26. package/dist/paperless/constraints.d.ts +50 -0
  27. package/dist/paperless/constraints.d.ts.map +1 -0
  28. package/dist/paperless/credentials.d.ts +40 -0
  29. package/dist/paperless/credentials.d.ts.map +1 -0
  30. package/dist/paperless/custom-field.d.ts +75 -0
  31. package/dist/paperless/custom-field.d.ts.map +1 -0
  32. package/dist/paperless/document-type.d.ts +30 -0
  33. package/dist/paperless/document-type.d.ts.map +1 -0
  34. package/dist/paperless/errors.d.ts +49 -0
  35. package/dist/paperless/errors.d.ts.map +1 -0
  36. package/dist/paperless/fake-paperless.d.ts +39 -0
  37. package/dist/paperless/fake-paperless.d.ts.map +1 -0
  38. package/dist/paperless/generated/constraints/index.d.ts +13 -0
  39. package/dist/paperless/generated/constraints/index.d.ts.map +1 -0
  40. package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts +21 -0
  41. package/dist/paperless/generated/constraints/paperless-custom_fields.d.ts.map +1 -0
  42. package/dist/paperless/generated/constraints/paperless-document_types.d.ts +21 -0
  43. package/dist/paperless/generated/constraints/paperless-document_types.d.ts.map +1 -0
  44. package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts +21 -0
  45. package/dist/paperless/generated/constraints/paperless-storage_paths.d.ts.map +1 -0
  46. package/dist/paperless/generated/constraints/paperless-tags.d.ts +21 -0
  47. package/dist/paperless/generated/constraints/paperless-tags.d.ts.map +1 -0
  48. package/dist/paperless/generated/types/custom-fields.d.ts +23 -0
  49. package/dist/paperless/generated/types/custom-fields.d.ts.map +1 -0
  50. package/dist/paperless/generated/types/document-types.d.ts +39 -0
  51. package/dist/paperless/generated/types/document-types.d.ts.map +1 -0
  52. package/dist/paperless/generated/types/index.d.ts +10 -0
  53. package/dist/paperless/generated/types/index.d.ts.map +1 -0
  54. package/dist/paperless/generated/types/storage-paths.d.ts +31 -0
  55. package/dist/paperless/generated/types/storage-paths.d.ts.map +1 -0
  56. package/dist/paperless/generated/types/tags.d.ts +37 -0
  57. package/dist/paperless/generated/types/tags.d.ts.map +1 -0
  58. package/dist/paperless/index.d.ts +19 -0
  59. package/dist/paperless/index.d.ts.map +1 -0
  60. package/dist/paperless/index.js +524 -0
  61. package/dist/paperless/index.js.map +26 -0
  62. package/dist/paperless/matching-locate.d.ts +33 -0
  63. package/dist/paperless/matching-locate.d.ts.map +1 -0
  64. package/dist/paperless/matching-types.d.ts +60 -0
  65. package/dist/paperless/matching-types.d.ts.map +1 -0
  66. package/dist/paperless/matching.d.ts +61 -0
  67. package/dist/paperless/matching.d.ts.map +1 -0
  68. package/dist/paperless/providers.d.ts +15 -0
  69. package/dist/paperless/providers.d.ts.map +1 -0
  70. package/dist/paperless/storage-path.d.ts +32 -0
  71. package/dist/paperless/storage-path.d.ts.map +1 -0
  72. package/dist/paperless/tag.d.ts +47 -0
  73. package/dist/paperless/tag.d.ts.map +1 -0
  74. package/dist/postgres/connection.d.ts +50 -0
  75. package/dist/postgres/connection.d.ts.map +1 -0
  76. package/dist/postgres/database-attrs.d.ts +79 -0
  77. package/dist/postgres/database-attrs.d.ts.map +1 -0
  78. package/dist/postgres/database-sql.d.ts +73 -0
  79. package/dist/postgres/database-sql.d.ts.map +1 -0
  80. package/dist/postgres/database.d.ts +63 -0
  81. package/dist/postgres/database.d.ts.map +1 -0
  82. package/dist/postgres/errors.d.ts +86 -0
  83. package/dist/postgres/errors.d.ts.map +1 -0
  84. package/dist/postgres/fake-sql.d.ts +22 -0
  85. package/dist/postgres/fake-sql.d.ts.map +1 -0
  86. package/dist/postgres/index.d.ts +16 -0
  87. package/dist/postgres/index.d.ts.map +1 -0
  88. package/dist/postgres/index.js +238 -0
  89. package/dist/postgres/index.js.map +15 -0
  90. package/dist/postgres/providers.d.ts +14 -0
  91. package/dist/postgres/providers.d.ts.map +1 -0
  92. package/dist/proxmox/index.js.map +2 -2
  93. package/dist/proxmox/zfs-pool.d.ts +10 -2
  94. package/dist/proxmox/zfs-pool.d.ts.map +1 -1
  95. package/dist/release/archive.d.ts +6 -2
  96. package/dist/release/archive.d.ts.map +1 -1
  97. package/dist/release/binary-form.d.ts +14 -9
  98. package/dist/release/binary-form.d.ts.map +1 -1
  99. package/dist/release/binary-pins.d.ts +17 -0
  100. package/dist/release/binary-pins.d.ts.map +1 -0
  101. package/dist/release/catalog.d.ts.map +1 -1
  102. package/dist/release/index.js +90 -40
  103. package/dist/release/index.js.map +8 -7
  104. package/dist/release/tar.d.ts +9 -2
  105. package/dist/release/tar.d.ts.map +1 -1
  106. package/docs/litellm.md +110 -0
  107. package/docs/paperless.md +115 -0
  108. package/docs/peers.md +8 -1
  109. package/docs/postgres.md +125 -0
  110. package/docs/release-binary-catalogs.md +40 -4
  111. package/docs/release-binary-refusals.md +22 -8
  112. package/docs/release-binary-upstream.md +33 -15
  113. package/package.json +14 -1
  114. package/src/litellm/client.ts +195 -0
  115. package/src/litellm/credentials.ts +73 -0
  116. package/src/litellm/fake-litellm.ts +114 -0
  117. package/src/litellm/fake-stack.ts +100 -0
  118. package/src/litellm/generated/pass-through.ts +73 -0
  119. package/src/litellm/index.ts +42 -0
  120. package/src/litellm/pass-through-endpoint-delete-swallow.test.ts +66 -0
  121. package/src/litellm/pass-through-endpoint-replace.test.ts +84 -0
  122. package/src/litellm/pass-through-endpoint.test.ts +208 -0
  123. package/src/litellm/pass-through-endpoint.ts +258 -0
  124. package/src/litellm/pass-through-form.test.ts +128 -0
  125. package/src/litellm/pass-through-form.ts +136 -0
  126. package/src/litellm/providers.ts +19 -0
  127. package/src/paperless/client.ts +88 -0
  128. package/src/paperless/constraint-guard.ts +50 -0
  129. package/src/paperless/constraints.test.ts +74 -0
  130. package/src/paperless/constraints.ts +111 -0
  131. package/src/paperless/credentials.ts +69 -0
  132. package/src/paperless/custom-field.test.ts +74 -0
  133. package/src/paperless/custom-field.ts +95 -0
  134. package/src/paperless/document-type.ts +74 -0
  135. package/src/paperless/errors.ts +62 -0
  136. package/src/paperless/fake-paperless.ts +156 -0
  137. package/src/paperless/generated/constraints/index.ts +23 -0
  138. package/src/paperless/generated/constraints/paperless-custom_fields.ts +29 -0
  139. package/src/paperless/generated/constraints/paperless-document_types.ts +32 -0
  140. package/src/paperless/generated/constraints/paperless-storage_paths.ts +34 -0
  141. package/src/paperless/generated/constraints/paperless-tags.ts +34 -0
  142. package/src/paperless/generated/types/custom-fields.ts +23 -0
  143. package/src/paperless/generated/types/document-types.ts +30 -0
  144. package/src/paperless/generated/types/index.ts +9 -0
  145. package/src/paperless/generated/types/storage-paths.ts +31 -0
  146. package/src/paperless/generated/types/tags.ts +37 -0
  147. package/src/paperless/index.ts +56 -0
  148. package/src/paperless/matching-identity.test.ts +194 -0
  149. package/src/paperless/matching-locate.ts +104 -0
  150. package/src/paperless/matching-types.ts +61 -0
  151. package/src/paperless/matching.test.ts +128 -0
  152. package/src/paperless/matching.ts +239 -0
  153. package/src/paperless/providers.ts +27 -0
  154. package/src/paperless/storage-path.ts +78 -0
  155. package/src/paperless/tag.ts +91 -0
  156. package/src/postgres/connection.ts +62 -0
  157. package/src/postgres/database-attrs.ts +87 -0
  158. package/src/postgres/database-bigint-serialization.test.ts +140 -0
  159. package/src/postgres/database-lifecycle.test.ts +113 -0
  160. package/src/postgres/database-provenance.test.ts +118 -0
  161. package/src/postgres/database-refusals.test.ts +135 -0
  162. package/src/postgres/database-sql.ts +174 -0
  163. package/src/postgres/database.ts +193 -0
  164. package/src/postgres/errors.ts +131 -0
  165. package/src/postgres/fake-sql.ts +123 -0
  166. package/src/postgres/fixtures/pg-REL_18_6-create-database-synopsis.txt +26 -0
  167. package/src/postgres/fixtures/pg-REL_18_6-pg_database.h.txt +67 -0
  168. package/src/postgres/index.ts +30 -0
  169. package/src/postgres/providers.ts +16 -0
  170. package/src/proxmox/zfs-pool.ts +10 -2
  171. package/src/release/archive.ts +10 -4
  172. package/src/release/binary-form.ts +24 -76
  173. package/src/release/binary-pins.ts +95 -0
  174. package/src/release/binary-root.test.ts +122 -0
  175. package/src/release/catalog.ts +10 -2
  176. package/src/release/tar-root.test.ts +114 -0
  177. package/src/release/tar.ts +78 -12
@@ -0,0 +1,15 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/postgres/connection.ts", "../src/postgres/database-attrs.ts", "../src/postgres/database-sql.ts", "../src/postgres/database.ts", "../src/postgres/errors.ts", "../src/postgres/providers.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Where a database's cluster comes from, and how each lifecycle operation gets a client.\n *\n * ⛔ NO ESTATE VALUE LIVES HERE. The kit is PUBLIC; the mini's socket path, its user and its\n * database names are the CONSUMER's props, passed to `postgresConnection(...)` in a house\n * stack — never a default, never a fallback (`docs/postgres.md#path`).\n * ★ A LAZY `Context.Service` WHOSE VALUE IS AN `Effect` (S24), THE SAME SHAPE THE HOUSE USES FOR\n * CREDENTIALS: `yield* yield* PostgresConnection` resolves the config INSIDE each operation,\n * never at layer build. Nothing here holds a secret today (`PostgresConnectionConfig` has no\n * `password` — S25, and CREATE DATABASE has none to assert either), but the shape is the one a\n * later TLS path (`Config.redacted` from the environment) drops into without a rewrite.\n * ★ THE POOL IS BUILT IN A SCOPE AND CLOSED PER OPERATION. `Effect.provide(op, PgClient.layer(config))`\n * already opens a scope for the layer's build and closes it when `op` finishes — one pool per\n * `withPg` call, never held across a whole `reconcile`.\n */\nimport * as PgClient from '@effect/sql-pg/PgClient';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport type { SqlError } from 'effect/unstable/sql/SqlError';\n\n/** What a stack passes to reach one cluster. `host` may be a socket directory (one beginning\n * with `/` expands to `${host}/.s.PGSQL.${port}` — measured in\n * `node_modules/@effect/sql-pg/src/PgConnection.ts`, the \"Details\" doc on `Config`) or a TCP\n * host name; `port` defaults to `@effect/sql-pg`'s own default (5432) when omitted. */\nexport interface PostgresConnectionConfig {\n readonly host: string;\n readonly port?: number;\n readonly database: string;\n readonly username: string;\n readonly ssl?: boolean;\n}\n\n/** The lazy connection service. Its value is an `Effect` of the config, per S24 — see the file\n * header for why. */\nexport class PostgresConnection extends Context.Service<\n PostgresConnection,\n Effect.Effect<PostgresConnectionConfig>\n>()('Postgres.Connection') {}\n\n/** A stack's one-line way to provide a cluster: `Layer.provide(postgresConnection({ … }))` on\n * `PostgresDatabaseProvider()`, or merged into the stack's own layer tree. */\nexport const postgresConnection = (\n config: PostgresConnectionConfig,\n): Layer.Layer<PostgresConnection> => Layer.succeed(PostgresConnection, Effect.succeed(config));\n\n/**\n * Run one operation against a freshly built, freshly closed connection pool.\n *\n * Every `read`, `reconcile` step and `delete` in this family calls this once for the whole\n * operation — never once per statement — so a reconcile that runs a `SELECT`, then a `CREATE`,\n * then a re-read shares one pool and closes it once, while a plan-only `read` still opens and\n * closes its own.\n */\nexport const withPg = <A, E>(\n build: (pg: PgClient.PgClient) => Effect.Effect<A, E>,\n): Effect.Effect<A, E | SqlError, PostgresConnection> =>\n Effect.gen(function* () {\n const resolveConfig = yield* PostgresConnection;\n const config = yield* resolveConfig;\n return yield* Effect.provide(Effect.flatMap(PgClient.PgClient, build), PgClient.layer(config));\n });\n",
6
+ "/**\n * `Postgres.Database` props and attributes, and the one prop-level check that runs before any\n * statement: the name's byte length against `NAMEDATALEN`.\n *\n * ⛔ EVERY ASSERTED PROP HERE HAS A CITED COLUMN. `docs/postgres.md#mapping` and\n * `database-provenance.test.ts` are what make that true rather than asserted: the test parses\n * the two committed fixtures (`create_database.sgml`'s synopsis, `pg_database.h`'s struct) and\n * fails if a prop here has no synopsis option or no catalog column behind it.\n * ⛔ NO PASSWORD, EVER. A database has none in `pg_database` (S25) — `CREATE DATABASE` has no\n * password option at all (`gram.y@REL_18_6#createdb_opt_name`, measured: `IDENT | CONNECTION\n * LIMIT | ENCODING | LOCATION | OWNER | TABLESPACE | TEMPLATE`).\n */\n\n/** NAMEDATALEN (`pg_config_manual.h@REL_18_6` line 29) minus the C string terminator: the\n * longest name the server stores without truncating. */\nexport const POSTGRES_NAME_MAX_BYTES = 63;\n\n/** UTF-8 byte length, the same unit `NAMEDATALEN` counts in (`scansup.c@REL_18_6#truncate_identifier`\n * clips by `pg_mbcliplen`, a byte-oriented, multibyte-aware clip — never a JS `.length`, which\n * counts UTF-16 code units and would pass a 63-byte multibyte name that is really 70+ bytes, or\n * refuse a 63-byte name whose `.length` looks smaller). */\nexport const utf8ByteLength = (value: string): number => new TextEncoder().encode(value).byteLength;\n\n/**\n * Declared, at-most-once-asserted properties of one database.\n *\n * Every prop here maps to a `CREATE DATABASE` `WITH` option `create_database.sgml` documents\n * AND a `pg_database` column that stores it (`database-provenance.test.ts`). `TEMPLATE`,\n * `STRATEGY` and `OID` are excluded because nothing in `pg_database` reads them back once the\n * database exists; `ICU_RULES` and `COLLATION_VERSION` are excluded for having no consumer in\n * this family today. See `docs/postgres.md#excluded`.\n */\nexport interface PostgresDatabaseProps {\n /** At most 63 UTF-8 bytes — refused at plan past that (`PostgresDatabaseNameRefused`). The\n * identity: a name change is a plan-time refusal, never a replace. */\n readonly name: string;\n /** A role name in `pg_roles`, asserted before create (`PostgresDatabaseOwnerMissing`) and\n * compared against `pg_get_userbyid(datdba)` on every plan thereafter. */\n readonly owner: string;\n /** `pg_encoding_to_char(datdatabase.encoding)`, e.g. `\"UTF8\"`. @default the template's. */\n readonly encoding?: string;\n /** `'builtin' | 'icu' | 'libc'` — `pg_database.datlocprovider` decoded\n * (`pg_collation.h@REL_18_6#collprovider_name`). @default the template's. */\n readonly localeProvider?: 'builtin' | 'icu' | 'libc';\n /** `pg_database.datcollate`. @default the template's. */\n readonly lcCollate?: string;\n /** `pg_database.datctype`. @default the template's. */\n readonly lcCtype?: string;\n /** `pg_database.datallowconn`. @default `true`. */\n readonly allowConnections?: boolean;\n /** `pg_database.datconnlimit`; `-1` means unlimited. @default `-1`. */\n readonly connectionLimit?: number;\n /** `pg_database.datistemplate`. @default `false`. */\n readonly isTemplate?: boolean;\n /** A tablespace name in `pg_tablespace`. @default the template's (usually `pg_default`). */\n readonly tablespace?: string;\n}\n\n/** Live attributes, read back after every reconcile. No `password` — see the file header. */\nexport interface PostgresDatabaseAttributes {\n readonly name: string;\n readonly oid: number;\n readonly owner: string;\n readonly encoding: string;\n readonly localeProvider: 'builtin' | 'icu' | 'libc';\n readonly collate: string;\n readonly ctype: string;\n readonly allowConnections: boolean;\n readonly connectionLimit: number;\n readonly isTemplate: boolean;\n readonly tablespace: string;\n}\n\n/**\n * Refuse a name the server would truncate, before any statement is built.\n *\n * ★ CALLED FROM `diff` (so a plan fails, never a deploy) AND FROM `reconcile` (so a fake or a\n * direct call gets the same refusal, never just a broken statement).\n */\nexport const nameByteRefusal = (\n name: string,\n): { readonly byteLength: number; readonly limit: number } | undefined => {\n const byteLength = utf8ByteLength(name);\n return byteLength > POSTGRES_NAME_MAX_BYTES\n ? { byteLength, limit: POSTGRES_NAME_MAX_BYTES }\n : undefined;\n};\n",
7
+ "/**\n * The four statements `Postgres.Database` ever issues, and the quoting each one needs.\n *\n * ⛔ `CREATE DATABASE` TAKES NO BIND PARAMETERS FOR ANY OF ITS VALUES, INCLUDING `OWNER`.\n * Measured at `gram.y@REL_18_6`: `CreatedbStmt: CREATE DATABASE name opt_with\n * createdb_opt_list`, and every `createdb_opt_item` value is `NumericOnly`,\n * `opt_boolean_or_string` or the bare keyword `DEFAULT` — none of those productions reaches\n * `PARAM` (`$n`). `sql\\`…\\`` cannot help here; every free-form value in this statement is\n * escaped by hand, once, in this file, and the assembled text runs through `.unsafe()`.\n * ⚠️ THE DATABASE NAME AND EFFECT'S OWN `sql(value)` IDENTIFIER HELPER DO NOT MIX. `name` is a\n * `ColId` (`gram.y@REL_18_6` line 17327), a single token — but `Statement.defaultEscape('\"')`\n * (what `sql(value)` compiles to) also rewrites every `.` in the value to `\".\"`, because it is\n * built for a *qualified* name like `schema.table`. A database named `\"my.app\"` would come out\n * as `\"my\".\"app\"` — two tokens where `CreatedbStmt` parses exactly one — a syntax error the\n * engine would blame on this provider. `quoteIdent` below is the single-token form: it quotes\n * and doubles embedded `\"`, and nothing else.\n * ★ EVERY OTHER `WITH` VALUE (`OWNER`, `TABLESPACE`, `ENCODING`, `LOCALE_PROVIDER`,\n * `LC_COLLATE`, `LC_CTYPE`) IS A STRING LITERAL, NOT AN IDENTIFIER. Measured at the same tag:\n * `createdb_opt_item`'s string branch is `opt_boolean_or_string → NonReservedWord_or_Sconst →\n * NonReservedWord | Sconst`. A locale like `en_US.UTF-8` would hit the same dot-splitting\n * `quoteIdent` avoids if it were identifier-quoted; a plain `Sconst` (`quoteStringLiteral`) has\n * no such rule. This rests on `standard_conforming_strings = on` (the PG18 default, and\n * measured live 2026-09-23 — `docs/postgres.md#measured`); the escaper only ever doubles `'`\n * and never emits a backslash, so it never depends on which way that setting points.\n */\nimport type { SqlError } from 'effect/unstable/sql/SqlError';\nimport * as Effect from 'effect/Effect';\nimport type { PostgresDatabaseAttributes, PostgresDatabaseProps } from './database-attrs.ts';\n\n/** What every function in this file needs from a client — real (`PgClient.PgClient`) or fake\n * (`fake-sql.ts`). Deliberately smaller than `SqlClient`: nothing here ever needs the tagged\n * template, transactions or streaming, because every statement is either bound params through\n * `.unsafe(text, params)` or a hand-escaped literal through `.unsafe(text)`. */\nexport interface PgExecutor {\n readonly unsafe: <A extends object>(\n sql: string,\n params?: ReadonlyArray<unknown>,\n ) => Effect.Effect<ReadonlyArray<A>, SqlError>;\n}\n\n/** Single-token identifier quoting: wrap in `\"`, double any embedded `\"`. No dot-splitting —\n * see the file header. Used for the database name and, since a role or tablespace name is a\n * `NonReservedWord` too, for `OWNER` and `TABLESPACE`. */\nexport const quoteIdent = (value: string): string => `\"${value.replace(/\"/g, '\"\"')}\"`;\n\n/** SQL string-literal quoting: wrap in `'`, double any embedded `'`. Used for every `WITH`\n * value that is locale or encoding text, never for an identifier (see the file header). */\nexport const quoteStringLiteral = (value: string): string => `'${value.replace(/'/g, \"''\")}'`;\n\nconst withOptions = (props: PostgresDatabaseProps): string => {\n const parts: string[] = [`OWNER ${quoteIdent(props.owner)}`];\n if (props.encoding !== undefined) parts.push(`ENCODING ${quoteStringLiteral(props.encoding)}`);\n if (props.localeProvider !== undefined) {\n parts.push(`LOCALE_PROVIDER ${quoteStringLiteral(props.localeProvider)}`);\n }\n if (props.lcCollate !== undefined)\n parts.push(`LC_COLLATE ${quoteStringLiteral(props.lcCollate)}`);\n if (props.lcCtype !== undefined) parts.push(`LC_CTYPE ${quoteStringLiteral(props.lcCtype)}`);\n if (props.tablespace !== undefined) parts.push(`TABLESPACE ${quoteIdent(props.tablespace)}`);\n if (props.allowConnections !== undefined) {\n parts.push(`ALLOW_CONNECTIONS ${props.allowConnections ? 'true' : 'false'}`);\n }\n if (props.connectionLimit !== undefined) {\n parts.push(`CONNECTION LIMIT ${String(Math.trunc(props.connectionLimit))}`);\n }\n if (props.isTemplate !== undefined)\n parts.push(`IS_TEMPLATE ${props.isTemplate ? 'true' : 'false'}`);\n return parts.join(' ');\n};\n\n/**\n * Build the exact `CREATE DATABASE` text — a pure function, unit-tested on its own with no\n * client at all. `CONNECTION LIMIT` and the two booleans are never string-escaped: an integer is\n * `Math.trunc`ed and stringified, and a boolean is one of exactly two literal words this file\n * writes, so no declared value reaches the statement through string interpolation unescaped.\n */\nexport const buildCreateDatabaseSql = (props: PostgresDatabaseProps): string =>\n `CREATE DATABASE ${quoteIdent(props.name)} WITH ${withOptions(props)}`;\n\n/** `42P04` (`duplicate_database`) is a race: something else created the name between our read\n * and our create. Measured at `internal/sqlError.ts@effect/sql-pg 4.0.0-rc.115`: every SQLSTATE\n * starting `42` — this one included — classifies as `SqlSyntaxError`, the same tag a genuine\n * syntax error would raise; there is no more specific tag to `catchTag` on. So this reads the\n * raw code PostgreSQL sent, carried on `reason.cause.code` (`PgConnection.ts#errorFromFields`,\n * `Object.assign(new Error(...), fields)`), rather than trusting the tag alone. */\nexport const isDuplicateDatabaseRace = (error: SqlError): boolean => {\n if (error.reason._tag !== 'SqlSyntaxError') return false;\n const cause = error.reason.cause;\n return (\n typeof cause === 'object' && cause !== null && (cause as { code?: unknown }).code === '42P04'\n );\n};\n\nconst ROLE_EXISTS_SQL = 'SELECT 1 AS present FROM pg_roles WHERE rolname = $1';\n\n/** `OWNER` is checked against `pg_roles` before any `CREATE`, so a missing role is\n * `PostgresDatabaseOwnerMissing` at reconcile time rather than the server's own\n * `ERROR: role \"…\" does not exist` surfacing as an unclassified statement failure. */\nexport const roleExists = (pg: PgExecutor, role: string): Effect.Effect<boolean, SqlError> =>\n Effect.map(\n pg.unsafe<{ readonly present: number }>(ROLE_EXISTS_SQL, [role]),\n (rows) => rows.length > 0,\n );\n\n/** `datlocprovider` is Postgres's internal 1-byte `\"char\"` type, which this client decodes as\n * raw bytes rather than text (measured 2026-09-23 against the live socket — `docs/postgres.md`);\n * the `CASE` maps it to the same three words `pg_collation.h@REL_18_6#collprovider_name` returns\n * for the same codes, so the row never crosses the wire as anything but ordinary `text`.\n *\n * ⛔ `oid` AND `datconnlimit` ARE READ AT THEIR NATIVE CATALOG WIDTH — NEVER CAST TO `::int8`.\n * `pg_database.h@REL_18_6` types them `Oid oid` (4 bytes, builtin OID 26) and\n * `int32 datconnlimit` (4 bytes, builtin OID 23); `@effect/sql-pg`'s codec table\n * (`PgTypes.ts@4.0.0-rc.115`) decodes both of those as a plain JS `number`\n * (`readUint32`/`readInt32`), matching `PostgresDatabaseAttributes`'s declared `number`\n * fields. Casting either to `::int8` changes the WIRE type the server sends, so the same\n * codec table decodes it as a JS `bigint` instead (`OID.int8`'s codec calls\n * `DataView.getBigInt64`) — and alchemy's `encodeState`\n * (`node_modules/alchemy/lib/State/StateEncoding.js`) has no `bigint` branch, so\n * `JSON.stringify`ing the persisted state throws `TypeError: Do not know how to serialize a\n * BigInt` on every successful reconcile, and a live `bigint` compared against a declared\n * `number` in `firstDrift` below is never `===`, so a matching `connectionLimit` reads as\n * permanent drift. Measured 2026-09-23; regression test:\n * `database-bigint-serialization.test.ts`. */\nconst SELECT_DATABASE_SQL = `SELECT\n d.oid AS oid,\n d.datname AS name,\n pg_get_userbyid(d.datdba) AS owner,\n pg_encoding_to_char(d.encoding) AS encoding,\n CASE d.datlocprovider\n WHEN 'b' THEN 'builtin' WHEN 'i' THEN 'icu' WHEN 'c' THEN 'libc'\n ELSE 'libc'\n END AS \"localeProvider\",\n d.datcollate AS collate,\n d.datctype AS ctype,\n d.datallowconn AS \"allowConnections\",\n d.datconnlimit AS \"connectionLimit\",\n d.datistemplate AS \"isTemplate\",\n t.spcname AS tablespace\n FROM pg_database d\n JOIN pg_tablespace t ON t.oid = d.dattablespace\n WHERE d.datname = $1`;\n\n/** The read: one bound `SELECT` on `pg_database`, joined to the two functions that turn its raw\n * owner and encoding columns into names (`docs/postgres.md#mapping`). `undefined` when the row\n * is absent — ownership branding happens one layer up, in `database.ts`, not here. */\nexport const selectDatabase = (\n pg: PgExecutor,\n name: string,\n): Effect.Effect<PostgresDatabaseAttributes | undefined, SqlError> =>\n Effect.map(pg.unsafe<PostgresDatabaseAttributes>(SELECT_DATABASE_SQL, [name]), (rows) => rows[0]);\n\n/** Compare every declared, asserted prop against the live row. Returns the name of the first\n * prop that drifted, or `undefined` when every declared prop matches. `name` and `owner` are\n * compared by their callers (identity and the create-time assertion), never here. */\nexport const firstDrift = (\n props: PostgresDatabaseProps,\n live: PostgresDatabaseAttributes,\n): { readonly prop: string; readonly declared: unknown; readonly live: unknown } | undefined => {\n const checks: ReadonlyArray<readonly [string, unknown, unknown]> = [\n ['encoding', props.encoding, live.encoding],\n ['localeProvider', props.localeProvider, live.localeProvider],\n ['lcCollate', props.lcCollate, live.collate],\n ['lcCtype', props.lcCtype, live.ctype],\n ['allowConnections', props.allowConnections, live.allowConnections],\n ['connectionLimit', props.connectionLimit, live.connectionLimit],\n ['isTemplate', props.isTemplate, live.isTemplate],\n ['tablespace', props.tablespace, live.tablespace],\n ];\n for (const [prop, declared, liveValue] of checks) {\n if (declared !== undefined && declared !== liveValue)\n return { prop, declared, live: liveValue };\n }\n return undefined;\n};\n",
8
+ "/**\n * `Postgres.Database` — create-and-assert over a self-hosted PostgreSQL 18 cluster.\n *\n * ⛔ THIS IS NOT AN ALTER-CAPABLE RESOURCE. Every optional prop is asserted ONCE, at create, and\n * compared against the live row on every later plan; a mismatch is a typed\n * `PostgresDatabaseDrift` refusal, never an `ALTER DATABASE`. `docs/postgres.md` says why:\n * several of these props (`LC_COLLATE`, `LC_CTYPE`, `LOCALE_PROVIDER`) cannot be altered on a\n * live database at all without `ALTER … REFRESH COLLATION VERSION` semantics this family does\n * not implement, and the rest are left alone on principle rather than by accident.\n * ⛔ `delete` NEVER DROPS. See `errors.ts#PostgresDatabaseDropRefused` and\n * `defaultRemovalPolicy: 'retain'` below — two independent reasons the engine never issues\n * `DROP DATABASE` through this provider.\n * ★ A DATABASE CARRIES NO OWNERSHIP MARK (H1). `read` always answers `Unowned` for a match, the\n * same rule `Cloudflare.Snippets.Snippet` uses for a marker-less API — so every one of the\n * mini's 19 already-live databases needs `adopt(true)` in the stack that declares it.\n */\nimport { Resource } from 'alchemy';\nimport { Unowned } from 'alchemy/AdoptPolicy';\nimport { isResolved } from 'alchemy/Diff';\nimport type { Input } from 'alchemy/Input';\nimport * as Provider from 'alchemy/Provider';\nimport * as Effect from 'effect/Effect';\nimport type { SqlError } from 'effect/unstable/sql/SqlError';\nimport type { PostgresDatabaseAttributes, PostgresDatabaseProps } from './database-attrs.ts';\nimport { nameByteRefusal } from './database-attrs.ts';\nimport {\n buildCreateDatabaseSql,\n firstDrift,\n isDuplicateDatabaseRace,\n roleExists,\n selectDatabase,\n} from './database-sql.ts';\nimport { type PostgresConnection, withPg } from './connection.ts';\nimport type { PgExecutor } from './database-sql.ts';\nimport {\n PostgresDatabaseCreateVanished,\n PostgresDatabaseDrift,\n PostgresDatabaseDropRefused,\n PostgresDatabaseNameRefused,\n PostgresDatabaseOwnerMissing,\n PostgresDatabaseRenameRefused,\n} from './errors.ts';\n\nexport interface PostgresDatabase extends Resource<\n 'Postgres.Database',\n PostgresDatabaseProps,\n PostgresDatabaseAttributes,\n never,\n PostgresConnection\n> {}\n\nexport const PostgresDatabase = Resource<PostgresDatabase>('Postgres.Database', {\n defaultRemovalPolicy: 'retain',\n});\n\n/** Mirrors `alchemy/Resource`'s own `isResourceOfType`: a resource constructor is a callable\n * `Object.assign`ed function, not a plain object, so `typeof` must accept both — a bare\n * `'object'` check (measured live in `scripts/smoke.ts`: it rejects `PostgresDatabase` itself,\n * matching only an instance) is the regression this comment exists to prevent. */\nexport const isPostgresDatabase = (value: unknown): value is PostgresDatabase =>\n (typeof value === 'object' || typeof value === 'function') &&\n value !== null &&\n (value as { Type?: unknown }).Type === 'Postgres.Database';\n\n/** Every asserted-prop mismatch against the LIVE row, owner included — reconcile's own\n * authoritative check, independent of what `diff` compared at plan time (S10: cloud state is\n * authoritative). */\nconst liveDrift = (props: PostgresDatabaseProps, live: PostgresDatabaseAttributes) => {\n if (props.owner !== live.owner) {\n return { prop: 'owner', declared: props.owner, live: live.owner };\n }\n return firstDrift(props, live);\n};\n\n/**\n * The core of `reconcile`, against any {@link PgExecutor} — the real pooled client through\n * `withPg`, or `fake-sql.ts`'s recording fake in tests. Kept apart from the provider wiring\n * below so a lifecycle test drives this exact function, not a re-implementation of it.\n */\nexport const reconcileWithClient = (\n pg: PgExecutor,\n props: PostgresDatabaseProps,\n): Effect.Effect<\n PostgresDatabaseAttributes,\n PostgresDatabaseOwnerMissing | PostgresDatabaseDrift | PostgresDatabaseCreateVanished | SqlError\n> =>\n Effect.gen(function* () {\n const observed = yield* selectDatabase(pg, props.name);\n if (observed === undefined) {\n const ownerPresent = yield* roleExists(pg, props.owner);\n if (!ownerPresent) {\n return yield* Effect.fail(\n new PostgresDatabaseOwnerMissing({ database: props.name, owner: props.owner }),\n );\n }\n yield* pg.unsafe(buildCreateDatabaseSql(props)).pipe(\n Effect.asVoid,\n Effect.catchTag('SqlError', (error) =>\n isDuplicateDatabaseRace(error) ? Effect.succeed(undefined) : Effect.fail(error),\n ),\n );\n // Never trust the write's own report (S10): re-read what the server actually stored.\n const created = yield* selectDatabase(pg, props.name);\n if (created === undefined) {\n return yield* Effect.fail(new PostgresDatabaseCreateVanished({ database: props.name }));\n }\n return created;\n }\n const drift = liveDrift(props, observed);\n if (drift !== undefined) {\n return yield* Effect.fail(\n new PostgresDatabaseDrift({\n database: props.name,\n prop: drift.prop,\n declared: drift.declared,\n live: drift.live,\n }),\n );\n }\n // Unchanged: the row already read is the authoritative answer. No write, no second round trip.\n return observed;\n });\n\n/** The core of `read`: one bound `SELECT`, no ownership branding — the caller (the provider's\n * `read` below, or a test) decides whether to wrap a match in `Unowned`. */\nexport const readWithClient = (pg: PgExecutor, name: string) => selectDatabase(pg, name);\n\n/**\n * The core of `diff`, entirely offline: `news` (declared) against `output` (last-applied\n * attributes) — never a live query (that authoritative check is `reconcileWithClient`'s job, per\n * S10). A rename is a plan-time refusal; over-long names are too, so a bad name never even reaches\n * `reconcile`; every other change answers `update`, which `reconcileWithClient` then either\n * applies (create) or refuses (drift on an already-live database).\n */\nexport const diffPostgresDatabase = (\n news: Input<PostgresDatabaseProps>,\n output: PostgresDatabaseAttributes | undefined,\n) =>\n Effect.gen(function* () {\n if (output === undefined || !isResolved(news)) return undefined;\n if (news.name !== output.name) {\n return yield* Effect.fail(\n new PostgresDatabaseRenameRefused({ from: output.name, to: news.name }),\n );\n }\n const nameRefusal = nameByteRefusal(news.name);\n if (nameRefusal !== undefined) {\n return yield* Effect.fail(\n new PostgresDatabaseNameRefused({ name: news.name, ...nameRefusal }),\n );\n }\n const changed = news.owner !== output.owner || firstDrift(news, output) !== undefined;\n return changed ? ({ action: 'update' } as const) : ({ action: 'noop' } as const);\n });\n\n/**\n * The five lifecycle handlers, wired to `withPg` for anything that touches a client. Exported\n * on its own — not only through {@link PostgresDatabaseProvider}'s `Layer` — so a test can call\n * `postgresDatabaseHandlers.delete(...)` directly, against the real implementation, without\n * standing up the engine's provider machinery.\n */\nexport const postgresDatabaseHandlers = PostgresDatabase.Provider.of({\n // ⚠️ EMPTY, NOT A LIVE SWEEP. Enumerating `pg_database` would list every database on the\n // cluster, most of which nothing declared — the same reasoning `NetboxPrefix` documents\n // for its own marker-less `list`. Adoption for this family is one declaration at a time.\n list: () => Effect.succeed([]),\n nuke: { skip: true },\n\n read: ({ olds, output }) =>\n Effect.gen(function* () {\n const name = output?.name ?? olds.name;\n const live = yield* withPg((pg) => readWithClient(pg, name));\n return live === undefined ? undefined : Unowned(live);\n }),\n\n diff: ({ news, output }) => diffPostgresDatabase(news, output),\n\n reconcile: ({ news }) =>\n Effect.gen(function* () {\n const nameRefusal = nameByteRefusal(news.name);\n if (nameRefusal !== undefined) {\n return yield* Effect.fail(\n new PostgresDatabaseNameRefused({ name: news.name, ...nameRefusal }),\n );\n }\n return yield* withPg((pg) => reconcileWithClient(pg, news));\n }),\n\n delete: ({ olds }) => Effect.fail(new PostgresDatabaseDropRefused({ database: olds.name })),\n});\n\nexport const PostgresDatabaseProvider = () =>\n Provider.succeed(PostgresDatabase, postgresDatabaseHandlers);\n",
9
+ "/**\n * `Postgres.Database`'s failures as typed tags (S21).\n *\n * ⛔ NONE OF THESE IS A STATUS-CODE OR MESSAGE MATCH. Every one is raised by this family's own\n * code from a fact it already checked (a byte count, a live catalog row, a role lookup) — never\n * from sniffing a driver error's text. The one live-SQLSTATE check this family makes —\n * `isDuplicateDatabaseRace` in `database-sql.ts`, for the `42P04` create race — reads the raw\n * code `@effect/sql-pg` classified onto `SqlSyntaxError.cause.code` (measured in\n * `node_modules/@effect/sql-pg/src/internal/sqlError.ts#classifySqlState`: every `42xxx` code,\n * `42P04` included, becomes `SqlSyntaxError` — there is no more specific tag for it), and it\n * never produces one of these tags: a race converges instead of failing.\n */\nimport * as Data from 'effect/Data';\n\n/**\n * A declared name would be silently truncated by the server (`NAMEDATALEN` 64, so 63 UTF-8\n * bytes is the last one that survives whole) — refused at plan, before any statement runs.\n *\n * ⛔ WHY THIS IS A PLAN-TIME REFUSAL AND NOT A SERVER ERROR. `truncate_identifier`\n * (`scansup.c@REL_18_6` line 93) clips a long name to 63 bytes and raises only a `NOTICE`\n * (`errcode(ERRCODE_NAME_TOO_LONG)`), never an error. A create would succeed against the\n * TRUNCATED name, so the next plan's read (`WHERE datname = $1`, the name exactly as\n * declared) would find nothing and try to create it again — forever. See\n * `doc/postgres.md#name`.\n */\nexport class PostgresDatabaseNameRefused extends Data.TaggedError('PostgresDatabaseNameRefused')<{\n readonly name: string;\n readonly byteLength: number;\n readonly limit: number;\n}> {\n override get message(): string {\n return (\n `Postgres.Database \"${this.name}\": ${String(this.byteLength)} UTF-8 bytes, over the ` +\n `${String(this.limit)}-byte limit (NAMEDATALEN 64, minus the terminator). PostgreSQL would ` +\n 'accept the CREATE and silently truncate the name with only a NOTICE, so this plan refuses ' +\n 'it instead of creating a database no later read will ever find again.'\n );\n }\n}\n\n/** A logical id's `name` changed. A database's name is its identity; there is no `ALTER … RENAME`\n * in this family's vocabulary (see `docs/postgres.md`), and `diff` never turns this into a\n * `replace` — a replace here is `DROP DATABASE` before `CREATE DATABASE`, on data. */\nexport class PostgresDatabaseRenameRefused extends Data.TaggedError(\n 'PostgresDatabaseRenameRefused',\n)<{\n readonly from: string;\n readonly to: string;\n}> {\n override get message(): string {\n return (\n `Postgres.Database: the declared name changed from \"${this.from}\" to \"${this.to}\". A ` +\n 'rename is refused at plan — this provider never replaces a database (that is DROP then ' +\n 'CREATE) and never runs ALTER … RENAME. Declare a new logical id for the new name, and ' +\n 'remove the old one once its data has moved.'\n );\n }\n}\n\n/** `OWNER` names a role `pg_roles` does not have, checked before the `CREATE DATABASE` that\n * would otherwise fail on it. Postgres itself refuses the same case with `ERROR: role \"…\" does\n * not exist` (`createdb()`, `dbcommands.c`) — this tag exists so the refusal is typed and the\n * check runs before any statement, not caught from the driver's text. */\nexport class PostgresDatabaseOwnerMissing extends Data.TaggedError('PostgresDatabaseOwnerMissing')<{\n readonly database: string;\n readonly owner: string;\n}> {\n override get message(): string {\n return `Postgres.Database \"${this.database}\": OWNER \"${this.owner}\" is not a role in pg_roles.`;\n }\n}\n\n/** A live, asserted property no longer matches the declaration. `reconcile` never issues an\n * `ALTER DATABASE` to fix this — see `docs/postgres.md` for why each asserted prop stops at\n * create. */\nexport class PostgresDatabaseDrift extends Data.TaggedError('PostgresDatabaseDrift')<{\n readonly database: string;\n readonly prop: string;\n readonly declared: unknown;\n readonly live: unknown;\n}> {\n override get message(): string {\n return (\n `Postgres.Database \"${this.database}\": ${this.prop} is declared as ` +\n `${JSON.stringify(this.declared)} but the live database has ${JSON.stringify(this.live)}. ` +\n 'This provider never issues ALTER DATABASE — update the declaration to match the live ' +\n 'value, or change it by hand and re-plan.'\n );\n }\n}\n\n/** `delete` never drops a database. `DROP DATABASE` is destructive and irreversible on data\n * this family did not create from nothing (most declared databases here are adopted, not\n * created); the decision to remove one stays a human act on the host. */\nexport class PostgresDatabaseDropRefused extends Data.TaggedError('PostgresDatabaseDropRefused')<{\n readonly database: string;\n}> {\n override get message(): string {\n return (\n `Postgres.Database \"${this.database}\": delete is refused. This provider never issues DROP ` +\n 'DATABASE. Drop it by hand over the trust socket if you mean to remove it, then remove the ' +\n 'declaration.'\n );\n }\n}\n\n/** `CREATE DATABASE` raised no error, but the immediate re-read (S10: never trust the write's\n * own report) still finds nothing. Measured to have no real trigger in a correctly speaking\n * client, but S20 forbids `Effect.die` here regardless — an invariant violation is a typed\n * failure the caller can see and retry, never a defect that crashes the whole engine. */\nexport class PostgresDatabaseCreateVanished extends Data.TaggedError(\n 'PostgresDatabaseCreateVanished',\n)<{\n readonly database: string;\n}> {\n override get message(): string {\n return (\n `Postgres.Database \"${this.database}\": CREATE DATABASE raised no error, but the database ` +\n 'is still absent on the immediate re-read. Re-plan — this is not a state this provider ' +\n 'expects to reach.'\n );\n }\n}\n\nexport type PostgresDatabaseError =\n | PostgresDatabaseNameRefused\n | PostgresDatabaseRenameRefused\n | PostgresDatabaseOwnerMissing\n | PostgresDatabaseDrift\n | PostgresDatabaseDropRefused\n | PostgresDatabaseCreateVanished;\n",
10
+ "/**\n * `Postgres.Database`'s provider, pre-wired to one cluster:\n *\n * const providers = postgresProviders({ host: '/opt/homeflare/postgres/sockets', database: 'postgres', username: 'tim' });\n *\n * ★ THE CLUSTER IS A PARAMETER, NOT A DEFAULT (S15, and `docs/postgres.md#path`). This kit is\n * PUBLIC; the mini's socket directory, its user and its port are the CONSUMING stack's values,\n * never baked in here. A stack with more than one cluster calls this more than once and merges\n * the results under whatever logical grouping it wants.\n */\nimport * as Layer from 'effect/Layer';\nimport { type PostgresConnectionConfig, postgresConnection } from './connection.ts';\nimport { PostgresDatabaseProvider } from './database.ts';\n\nexport const postgresProviders = (config: PostgresConnectionConfig) =>\n PostgresDatabaseProvider().pipe(Layer.provide(postgresConnection(config)));\n"
11
+ ],
12
+ "mappings": ";AAeA;AACA;AACA;AACA;AAAA;AAiBO,MAAM,2BAAmC,gBAG9C,EAAE,qBAAqB,EAAE;AAAC;AAIrB,IAAM,qBAAqB,CAChC,WAC0C,cAAQ,oBAA2B,eAAQ,MAAM,CAAC;AAUvF,IAAM,SAAS,CACpB,UAEO,WAAI,UAAU,GAAG;AAAA,EACtB,MAAM,gBAAgB,OAAO;AAAA,EAC7B,MAAM,SAAS,OAAO;AAAA,EACtB,OAAO,OAAc,eAAe,eAAiB,mBAAU,KAAK,GAAY,eAAM,MAAM,CAAC;AAAA,CAC9F;;AC9CI,IAAM,0BAA0B;AAMhC,IAAM,iBAAiB,CAAC,UAA0B,IAAI,YAAY,EAAE,OAAO,KAAK,EAAE;AA0DlF,IAAM,kBAAkB,CAC7B,SACwE;AAAA,EACxE,MAAM,aAAa,eAAe,IAAI;AAAA,EACtC,OAAO,aAAa,0BAChB,EAAE,YAAY,OAAO,wBAAwB,IAC7C;AAAA;;AC3DN;AAiBO,IAAM,aAAa,CAAC,UAA0B,IAAI,MAAM,QAAQ,MAAM,IAAI;AAI1E,IAAM,qBAAqB,CAAC,UAA0B,IAAI,MAAM,QAAQ,MAAM,IAAI;AAEzF,IAAM,cAAc,CAAC,UAAyC;AAAA,EAC5D,MAAM,QAAkB,CAAC,SAAS,WAAW,MAAM,KAAK,GAAG;AAAA,EAC3D,IAAI,MAAM,aAAa;AAAA,IAAW,MAAM,KAAK,YAAY,mBAAmB,MAAM,QAAQ,GAAG;AAAA,EAC7F,IAAI,MAAM,mBAAmB,WAAW;AAAA,IACtC,MAAM,KAAK,mBAAmB,mBAAmB,MAAM,cAAc,GAAG;AAAA,EAC1E;AAAA,EACA,IAAI,MAAM,cAAc;AAAA,IACtB,MAAM,KAAK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;AAAA,EAC7B,MAAM,EAAE,MAAM,KAAK;AAAA,EAEnB,MAAM,GAAG,MAAM,aACN,YAAI,UAAU,GAAG;AAAA,IACtB,MAAM,OAAO,QAAQ,QAAQ,KAAK;AAAA,IAClC,MAAM,OAAO,OAAO,OAAO,CAAC,OAAO,eAAe,IAAI,IAAI,CAAC;AAAA,IAC3D,OAAO,SAAS,YAAY,YAAY,QAAQ,IAAI;AAAA,GACrD;AAAA,EAEH,MAAM,GAAG,MAAM,aAAa,qBAAqB,MAAM,MAAM;AAAA,EAE7D,WAAW,GAAG,WACL,YAAI,UAAU,GAAG;AAAA,IACtB,MAAM,cAAc,gBAAgB,KAAK,IAAI;AAAA,IAC7C,IAAI,gBAAgB,WAAW;AAAA,MAC7B,OAAO,OAAc,aACnB,IAAI,4BAA4B,EAAE,MAAM,KAAK,SAAS,YAAY,CAAC,CACrE;AAAA,IACF;AAAA,IACA,OAAO,OAAO,OAAO,CAAC,OAAO,oBAAoB,IAAI,IAAI,CAAC;AAAA,GAC3D;AAAA,EAEH,QAAQ,GAAG,WAAkB,aAAK,IAAI,4BAA4B,EAAE,UAAU,KAAK,KAAK,CAAC,CAAC;AAC5F,CAAC;AAEM,IAAM,2BAA2B,MAC7B,iBAAQ,kBAAkB,wBAAwB;;AEtL7D;AAIO,IAAM,oBAAoB,CAAC,WAChC,yBAAyB,EAAE,KAAW,eAAQ,mBAAmB,MAAM,CAAC,CAAC;",
13
+ "debugId": "84B82CBA6D8F3F5F64756E2164756E21",
14
+ "names": []
15
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `Postgres.Database`'s provider, pre-wired to one cluster:
3
+ *
4
+ * const providers = postgresProviders({ host: '/opt/homeflare/postgres/sockets', database: 'postgres', username: 'tim' });
5
+ *
6
+ * ★ THE CLUSTER IS A PARAMETER, NOT A DEFAULT (S15, and `docs/postgres.md#path`). This kit is
7
+ * PUBLIC; the mini's socket directory, its user and its port are the CONSUMING stack's values,
8
+ * never baked in here. A stack with more than one cluster calls this more than once and merges
9
+ * the results under whatever logical grouping it wants.
10
+ */
11
+ import * as Layer from 'effect/Layer';
12
+ import { type PostgresConnectionConfig } from './connection.ts';
13
+ export declare const postgresProviders: (config: PostgresConnectionConfig) => Layer.Layer<import("alchemy").Provider<import("./database.ts").PostgresDatabase>, never, never>;
14
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/postgres/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,wBAAwB,EAAsB,MAAM,iBAAiB,CAAC;AAGpF,eAAO,MAAM,iBAAiB,WAAY,wBAAwB,oGACU,CAAC"}