@danielfgray/pg-sourcerer 0.2.2 → 0.4.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 (307) hide show
  1. package/bin/pgsourcerer +2 -0
  2. package/dist/__tests__/fixtures/index.d.ts +15 -0
  3. package/dist/__tests__/fixtures/index.d.ts.map +1 -0
  4. package/dist/__tests__/fixtures/index.js +19 -0
  5. package/dist/__tests__/fixtures/index.js.map +1 -0
  6. package/dist/__tests__/fixtures/introspection.json +40522 -0
  7. package/dist/cli.d.ts +0 -1
  8. package/dist/cli.js +7 -46
  9. package/dist/cli.js.map +1 -1
  10. package/dist/config.d.ts +38 -5
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js +13 -2
  13. package/dist/config.js.map +1 -1
  14. package/dist/{lib/conjure.d.ts → conjure/index.d.ts} +62 -3
  15. package/dist/conjure/index.d.ts.map +1 -0
  16. package/dist/{lib/conjure.js → conjure/index.js} +124 -3
  17. package/dist/conjure/index.js.map +1 -0
  18. package/dist/conjure/signature.d.ts +85 -0
  19. package/dist/conjure/signature.d.ts.map +1 -0
  20. package/dist/conjure/signature.js +130 -0
  21. package/dist/conjure/signature.js.map +1 -0
  22. package/dist/conjure/types.d.ts +97 -0
  23. package/dist/conjure/types.d.ts.map +1 -0
  24. package/dist/conjure/types.js +206 -0
  25. package/dist/conjure/types.js.map +1 -0
  26. package/dist/errors.d.ts +114 -139
  27. package/dist/errors.d.ts.map +1 -1
  28. package/dist/errors.js +82 -36
  29. package/dist/errors.js.map +1 -1
  30. package/dist/generate.d.ts +45 -46
  31. package/dist/generate.d.ts.map +1 -1
  32. package/dist/generate.js +86 -59
  33. package/dist/generate.js.map +1 -1
  34. package/dist/hex/builder.d.ts +12 -0
  35. package/dist/hex/builder.d.ts.map +1 -0
  36. package/dist/hex/builder.js +64 -0
  37. package/dist/hex/builder.js.map +1 -0
  38. package/dist/hex/ddl.d.ts +53 -0
  39. package/dist/hex/ddl.d.ts.map +1 -0
  40. package/dist/hex/ddl.js +306 -0
  41. package/dist/hex/ddl.js.map +1 -0
  42. package/dist/hex/index.d.ts +105 -0
  43. package/dist/hex/index.d.ts.map +1 -0
  44. package/dist/hex/index.js +81 -0
  45. package/dist/hex/index.js.map +1 -0
  46. package/dist/hex/primitives.d.ts +23 -0
  47. package/dist/hex/primitives.d.ts.map +1 -0
  48. package/dist/hex/primitives.js +38 -0
  49. package/dist/hex/primitives.js.map +1 -0
  50. package/dist/hex/query.d.ts +116 -0
  51. package/dist/hex/query.d.ts.map +1 -0
  52. package/dist/hex/query.js +219 -0
  53. package/dist/hex/query.js.map +1 -0
  54. package/dist/hex/types.d.ts +287 -0
  55. package/dist/hex/types.d.ts.map +1 -0
  56. package/dist/hex/types.js +431 -0
  57. package/dist/hex/types.js.map +1 -0
  58. package/dist/index.d.ts +17 -25
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +33 -44
  61. package/dist/index.js.map +1 -1
  62. package/dist/init.d.ts.map +1 -1
  63. package/dist/init.js +76 -140
  64. package/dist/init.js.map +1 -1
  65. package/dist/ir/extensions/queries.d.ts +6 -6
  66. package/dist/ir/extensions/queries.d.ts.map +1 -1
  67. package/dist/ir/extensions/queries.js +6 -4
  68. package/dist/ir/extensions/queries.js.map +1 -1
  69. package/dist/ir/extensions/schema-builder.d.ts.map +1 -1
  70. package/dist/ir/extensions/schema-builder.js.map +1 -1
  71. package/dist/ir/index.d.ts.map +1 -1
  72. package/dist/ir/index.js.map +1 -1
  73. package/dist/ir/relation-graph.d.ts.map +1 -1
  74. package/dist/ir/relation-graph.js +8 -8
  75. package/dist/ir/relation-graph.js.map +1 -1
  76. package/dist/ir/semantic-ir.d.ts +38 -0
  77. package/dist/ir/semantic-ir.d.ts.map +1 -1
  78. package/dist/ir/semantic-ir.js +50 -2
  79. package/dist/ir/semantic-ir.js.map +1 -1
  80. package/dist/ir/smart-tags.d.ts.map +1 -1
  81. package/dist/ir/smart-tags.js.map +1 -1
  82. package/dist/lib/field-utils.d.ts.map +1 -1
  83. package/dist/lib/field-utils.js +7 -7
  84. package/dist/lib/field-utils.js.map +1 -1
  85. package/dist/lib/join-graph.d.ts +95 -0
  86. package/dist/lib/join-graph.d.ts.map +1 -0
  87. package/dist/lib/join-graph.js +305 -0
  88. package/dist/lib/join-graph.js.map +1 -0
  89. package/dist/lib/picker.d.ts +60 -0
  90. package/dist/lib/picker.d.ts.map +1 -0
  91. package/dist/lib/picker.js +325 -0
  92. package/dist/lib/picker.js.map +1 -0
  93. package/dist/plugins/arktype.d.ts +20 -24
  94. package/dist/plugins/arktype.d.ts.map +1 -1
  95. package/dist/plugins/arktype.js +462 -386
  96. package/dist/plugins/arktype.js.map +1 -1
  97. package/dist/plugins/effect/http.d.ts +7 -0
  98. package/dist/plugins/effect/http.d.ts.map +1 -0
  99. package/dist/plugins/effect/http.js +460 -0
  100. package/dist/plugins/effect/http.js.map +1 -0
  101. package/dist/plugins/effect/index.d.ts +22 -0
  102. package/dist/plugins/effect/index.d.ts.map +1 -0
  103. package/dist/plugins/effect/index.js +65 -0
  104. package/dist/plugins/effect/index.js.map +1 -0
  105. package/dist/plugins/effect/models.d.ts +6 -0
  106. package/dist/plugins/effect/models.d.ts.map +1 -0
  107. package/dist/plugins/effect/models.js +116 -0
  108. package/dist/plugins/effect/models.js.map +1 -0
  109. package/dist/plugins/effect/repos.d.ts +21 -0
  110. package/dist/plugins/effect/repos.d.ts.map +1 -0
  111. package/dist/plugins/effect/repos.js +131 -0
  112. package/dist/plugins/effect/repos.js.map +1 -0
  113. package/dist/plugins/effect/schemas.d.ts +7 -0
  114. package/dist/plugins/effect/schemas.d.ts.map +1 -0
  115. package/dist/plugins/effect/schemas.js +75 -0
  116. package/dist/plugins/effect/schemas.js.map +1 -0
  117. package/dist/plugins/effect/shared.d.ts +116 -0
  118. package/dist/plugins/effect/shared.d.ts.map +1 -0
  119. package/dist/plugins/effect/shared.js +164 -0
  120. package/dist/plugins/effect/shared.js.map +1 -0
  121. package/dist/plugins/http-elysia.d.ts +20 -27
  122. package/dist/plugins/http-elysia.d.ts.map +1 -1
  123. package/dist/plugins/http-elysia.js +350 -475
  124. package/dist/plugins/http-elysia.js.map +1 -1
  125. package/dist/plugins/http-express.d.ts +20 -31
  126. package/dist/plugins/http-express.d.ts.map +1 -1
  127. package/dist/plugins/http-express.js +281 -268
  128. package/dist/plugins/http-express.js.map +1 -1
  129. package/dist/plugins/http-hono.d.ts +17 -33
  130. package/dist/plugins/http-hono.d.ts.map +1 -1
  131. package/dist/plugins/http-hono.js +317 -341
  132. package/dist/plugins/http-hono.js.map +1 -1
  133. package/dist/plugins/http-orpc.d.ts +34 -33
  134. package/dist/plugins/http-orpc.d.ts.map +1 -1
  135. package/dist/plugins/http-orpc.js +345 -257
  136. package/dist/plugins/http-orpc.js.map +1 -1
  137. package/dist/plugins/http-trpc.d.ts +33 -35
  138. package/dist/plugins/http-trpc.d.ts.map +1 -1
  139. package/dist/plugins/http-trpc.js +337 -241
  140. package/dist/plugins/http-trpc.js.map +1 -1
  141. package/dist/plugins/kysely.d.ts +54 -59
  142. package/dist/plugins/kysely.d.ts.map +1 -1
  143. package/dist/plugins/kysely.js +826 -687
  144. package/dist/plugins/kysely.js.map +1 -1
  145. package/dist/plugins/sql-queries.d.ts +38 -44
  146. package/dist/plugins/sql-queries.d.ts.map +1 -1
  147. package/dist/plugins/sql-queries.js +497 -897
  148. package/dist/plugins/sql-queries.js.map +1 -1
  149. package/dist/plugins/types.d.ts +12 -20
  150. package/dist/plugins/types.d.ts.map +1 -1
  151. package/dist/plugins/types.js +84 -227
  152. package/dist/plugins/types.js.map +1 -1
  153. package/dist/plugins/valibot.d.ts +7 -44
  154. package/dist/plugins/valibot.d.ts.map +1 -1
  155. package/dist/plugins/valibot.js +376 -382
  156. package/dist/plugins/valibot.js.map +1 -1
  157. package/dist/plugins/zod.d.ts +20 -24
  158. package/dist/plugins/zod.d.ts.map +1 -1
  159. package/dist/plugins/zod.js +370 -367
  160. package/dist/plugins/zod.js.map +1 -1
  161. package/dist/runtime/emit.d.ts +64 -0
  162. package/dist/runtime/emit.d.ts.map +1 -0
  163. package/dist/runtime/emit.js +445 -0
  164. package/dist/runtime/emit.js.map +1 -0
  165. package/dist/runtime/errors.d.ts +36 -0
  166. package/dist/runtime/errors.d.ts.map +1 -0
  167. package/dist/runtime/errors.js +29 -0
  168. package/dist/runtime/errors.js.map +1 -0
  169. package/dist/runtime/file-assignment.d.ts +161 -0
  170. package/dist/runtime/file-assignment.d.ts.map +1 -0
  171. package/dist/runtime/file-assignment.js +195 -0
  172. package/dist/runtime/file-assignment.js.map +1 -0
  173. package/dist/runtime/orchestrator.d.ts +62 -0
  174. package/dist/runtime/orchestrator.d.ts.map +1 -0
  175. package/dist/runtime/orchestrator.js +99 -0
  176. package/dist/runtime/orchestrator.js.map +1 -0
  177. package/dist/runtime/registry.d.ts +268 -0
  178. package/dist/runtime/registry.d.ts.map +1 -0
  179. package/dist/runtime/registry.js +436 -0
  180. package/dist/runtime/registry.js.map +1 -0
  181. package/dist/runtime/types.d.ts +182 -0
  182. package/dist/runtime/types.d.ts.map +1 -0
  183. package/dist/runtime/types.js +2 -0
  184. package/dist/runtime/types.js.map +1 -0
  185. package/dist/runtime/validation.d.ts +41 -0
  186. package/dist/runtime/validation.d.ts.map +1 -0
  187. package/dist/runtime/validation.js +70 -0
  188. package/dist/runtime/validation.js.map +1 -0
  189. package/dist/services/config-loader.d.ts.map +1 -1
  190. package/dist/services/config-loader.js +15 -6
  191. package/dist/services/config-loader.js.map +1 -1
  192. package/dist/services/config.d.ts +55 -25
  193. package/dist/services/config.d.ts.map +1 -1
  194. package/dist/services/config.js +60 -34
  195. package/dist/services/config.js.map +1 -1
  196. package/dist/services/file-writer.d.ts +3 -3
  197. package/dist/services/file-writer.d.ts.map +1 -1
  198. package/dist/services/file-writer.js +6 -8
  199. package/dist/services/file-writer.js.map +1 -1
  200. package/dist/services/inflection.d.ts +126 -27
  201. package/dist/services/inflection.d.ts.map +1 -1
  202. package/dist/services/inflection.js +300 -72
  203. package/dist/services/inflection.js.map +1 -1
  204. package/dist/services/introspection.d.ts.map +1 -1
  205. package/dist/services/introspection.js +6 -6
  206. package/dist/services/introspection.js.map +1 -1
  207. package/dist/services/ir-builder.d.ts.map +1 -1
  208. package/dist/services/ir-builder.js +73 -77
  209. package/dist/services/ir-builder.js.map +1 -1
  210. package/dist/services/ir.d.ts.map +1 -1
  211. package/dist/services/ir.js.map +1 -1
  212. package/dist/services/pg-types.d.ts.map +1 -1
  213. package/dist/services/pg-types.js +3 -3
  214. package/dist/services/pg-types.js.map +1 -1
  215. package/dist/services/smart-tags-parser.d.ts.map +1 -1
  216. package/dist/services/smart-tags-parser.js +4 -4
  217. package/dist/services/smart-tags-parser.js.map +1 -1
  218. package/dist/services/type-hints.d.ts.map +1 -1
  219. package/dist/services/type-hints.js +1 -1
  220. package/dist/services/type-hints.js.map +1 -1
  221. package/dist/services/user-module-parser.d.ts +46 -0
  222. package/dist/services/user-module-parser.d.ts.map +1 -0
  223. package/dist/services/user-module-parser.js +181 -0
  224. package/dist/services/user-module-parser.js.map +1 -0
  225. package/dist/shared/converters.d.ts +60 -0
  226. package/dist/shared/converters.d.ts.map +1 -0
  227. package/dist/shared/converters.js +168 -0
  228. package/dist/shared/converters.js.map +1 -0
  229. package/dist/shared/query-types.d.ts +95 -0
  230. package/dist/shared/query-types.d.ts.map +1 -0
  231. package/dist/shared/query-types.js +9 -0
  232. package/dist/shared/query-types.js.map +1 -0
  233. package/dist/testing.d.ts +125 -37
  234. package/dist/testing.d.ts.map +1 -1
  235. package/dist/testing.js +134 -42
  236. package/dist/testing.js.map +1 -1
  237. package/dist/user-module.d.ts +86 -0
  238. package/dist/user-module.d.ts.map +1 -0
  239. package/dist/user-module.js +55 -0
  240. package/dist/user-module.js.map +1 -0
  241. package/package.json +10 -6
  242. package/dist/lib/conjure.d.ts.map +0 -1
  243. package/dist/lib/conjure.js.map +0 -1
  244. package/dist/lib/hex.d.ts +0 -119
  245. package/dist/lib/hex.d.ts.map +0 -1
  246. package/dist/lib/hex.js +0 -188
  247. package/dist/lib/hex.js.map +0 -1
  248. package/dist/plugins/effect.d.ts +0 -53
  249. package/dist/plugins/effect.d.ts.map +0 -1
  250. package/dist/plugins/effect.js +0 -1074
  251. package/dist/plugins/effect.js.map +0 -1
  252. package/dist/plugins/kysely/queries.d.ts +0 -92
  253. package/dist/plugins/kysely/queries.d.ts.map +0 -1
  254. package/dist/plugins/kysely/queries.js +0 -1169
  255. package/dist/plugins/kysely/queries.js.map +0 -1
  256. package/dist/plugins/kysely/shared.d.ts +0 -59
  257. package/dist/plugins/kysely/shared.d.ts.map +0 -1
  258. package/dist/plugins/kysely/shared.js +0 -247
  259. package/dist/plugins/kysely/shared.js.map +0 -1
  260. package/dist/plugins/kysely/types.d.ts +0 -22
  261. package/dist/plugins/kysely/types.d.ts.map +0 -1
  262. package/dist/plugins/kysely/types.js +0 -428
  263. package/dist/plugins/kysely/types.js.map +0 -1
  264. package/dist/services/artifact-store.d.ts +0 -65
  265. package/dist/services/artifact-store.d.ts.map +0 -1
  266. package/dist/services/artifact-store.js +0 -57
  267. package/dist/services/artifact-store.js.map +0 -1
  268. package/dist/services/core-providers.d.ts +0 -15
  269. package/dist/services/core-providers.d.ts.map +0 -1
  270. package/dist/services/core-providers.js +0 -23
  271. package/dist/services/core-providers.js.map +0 -1
  272. package/dist/services/emissions.d.ts +0 -103
  273. package/dist/services/emissions.d.ts.map +0 -1
  274. package/dist/services/emissions.js +0 -241
  275. package/dist/services/emissions.js.map +0 -1
  276. package/dist/services/execution.d.ts +0 -35
  277. package/dist/services/execution.d.ts.map +0 -1
  278. package/dist/services/execution.js +0 -86
  279. package/dist/services/execution.js.map +0 -1
  280. package/dist/services/file-builder.d.ts +0 -85
  281. package/dist/services/file-builder.d.ts.map +0 -1
  282. package/dist/services/file-builder.js +0 -112
  283. package/dist/services/file-builder.js.map +0 -1
  284. package/dist/services/plugin-meta.d.ts +0 -33
  285. package/dist/services/plugin-meta.d.ts.map +0 -1
  286. package/dist/services/plugin-meta.js +0 -24
  287. package/dist/services/plugin-meta.js.map +0 -1
  288. package/dist/services/plugin-runner.d.ts +0 -42
  289. package/dist/services/plugin-runner.d.ts.map +0 -1
  290. package/dist/services/plugin-runner.js +0 -84
  291. package/dist/services/plugin-runner.js.map +0 -1
  292. package/dist/services/plugin.d.ts +0 -421
  293. package/dist/services/plugin.d.ts.map +0 -1
  294. package/dist/services/plugin.js +0 -197
  295. package/dist/services/plugin.js.map +0 -1
  296. package/dist/services/resolution.d.ts +0 -38
  297. package/dist/services/resolution.d.ts.map +0 -1
  298. package/dist/services/resolution.js +0 -242
  299. package/dist/services/resolution.js.map +0 -1
  300. package/dist/services/service-registry.d.ts +0 -74
  301. package/dist/services/service-registry.d.ts.map +0 -1
  302. package/dist/services/service-registry.js +0 -61
  303. package/dist/services/service-registry.js.map +0 -1
  304. package/dist/services/symbols.d.ts +0 -144
  305. package/dist/services/symbols.d.ts.map +0 -1
  306. package/dist/services/symbols.js +0 -144
  307. package/dist/services/symbols.js.map +0 -1
@@ -1,428 +0,0 @@
1
- // @ts-nocheck - TODO: migrate to new plugin API
2
- /**
3
- * Kysely Types Generation
4
- *
5
- * Generates table interfaces with Generated<T>, ColumnType<S, I, U>, and DB interface.
6
- * Uses RLS permissions to determine Generated<T> wrapping.
7
- */
8
- import { Option, pipe } from "effect";
9
- import { findEnumByPgName, findCompositeByPgName, PgTypeOid } from "../../services/pg-types.js";
10
- import { getEnumEntities, getTableEntities, getCompositeEntities } from "../../ir/semantic-ir.js";
11
- import { conjure } from "../../lib/conjure.js";
12
- import { isEnumType, getPgTypeName } from "../../lib/field-utils.js";
13
- import { getExtensionTypeMapping } from "../../services/pg-types.js";
14
- import { SCALAR_TYPES, COMPLEX_TYPES, GENERATED_TYPE_DEF, ARRAY_TYPE_DEF, ARRAY_TYPE_IMPL_DEF, } from "./shared.js";
15
- const { ts, exp } = conjure;
16
- /** Default config values */
17
- export const defaultTypesConfig = {
18
- outputFile: "db.ts",
19
- runtimeEnums: false,
20
- typeOnlyImports: true,
21
- };
22
- // ============================================================================
23
- // Type Resolution
24
- // ============================================================================
25
- /** Build TypeHintFieldMatch from field and context */
26
- const buildFieldMatch = (field, ctx) => ({
27
- schema: ctx.schemaName,
28
- table: ctx.tableName,
29
- column: field.columnName,
30
- pgType: field.isArray && field.elementTypeName
31
- ? field.elementTypeName
32
- : (field.pgAttribute.getType()?.typname ?? ""),
33
- });
34
- /**
35
- * Resolve a field to its Kysely type.
36
- * Handles: TypeHints, enums, complex types, scalar types, extensions.
37
- */
38
- function resolveFieldType(field, ctx) {
39
- const pgType = field.pgAttribute.getType();
40
- const typeName = pgType?.typname ?? "";
41
- // 1. Check TypeHints first (highest priority)
42
- const fieldMatch = buildFieldMatch(field, ctx);
43
- const tsTypeHint = ctx.typeHints.getHint(fieldMatch, "tsType");
44
- if (Option.isSome(tsTypeHint)) {
45
- const hintTypeName = tsTypeHint.value;
46
- const importPath = ctx.typeHints.getHint(fieldMatch, "import");
47
- return {
48
- selectType: ts.ref(hintTypeName),
49
- needsColumnType: false,
50
- externalImport: pipe(importPath, Option.map(path => ({ name: hintTypeName, from: path })), Option.getOrUndefined),
51
- };
52
- }
53
- // 2. Check if it's an enum
54
- if (isEnumType(field)) {
55
- const enumName = getPgTypeName(field);
56
- if (enumName) {
57
- const enumDef = findEnumByPgName(ctx.enums, enumName);
58
- if (Option.isSome(enumDef)) {
59
- return {
60
- selectType: ts.ref(enumDef.value.name),
61
- needsColumnType: false,
62
- };
63
- }
64
- }
65
- }
66
- // 3. Check if it's a composite type
67
- if (pgType?.typtype === "c") {
68
- const compositeName = getPgTypeName(field);
69
- if (compositeName) {
70
- const compositeDef = findCompositeByPgName(ctx.composites, compositeName);
71
- if (Option.isSome(compositeDef)) {
72
- return {
73
- selectType: ts.ref(compositeDef.value.name),
74
- needsColumnType: false,
75
- };
76
- }
77
- }
78
- }
79
- // 4. Check complex types (need ColumnType wrapper)
80
- const complexType = COMPLEX_TYPES[typeName];
81
- if (complexType) {
82
- return {
83
- selectType: complexType.select(),
84
- insertType: complexType.insert(),
85
- updateType: complexType.update(),
86
- needsColumnType: true,
87
- externalImport: complexType.import,
88
- };
89
- }
90
- // 5. Check simple scalar types
91
- const scalarBuilder = SCALAR_TYPES[typeName];
92
- if (scalarBuilder) {
93
- return {
94
- selectType: scalarBuilder(),
95
- needsColumnType: false,
96
- };
97
- }
98
- // 6. Check extension types (citext, etc.)
99
- if (pgType) {
100
- const extType = getExtensionTypeMapping(typeName, String(pgType.typnamespace), ctx.extensions);
101
- if (Option.isSome(extType)) {
102
- return {
103
- selectType: ts.fromString(extType.value),
104
- needsColumnType: false,
105
- };
106
- }
107
- }
108
- // 7. Default to string (PostgreSQL sends unknown types as strings)
109
- return {
110
- selectType: ts.string(),
111
- needsColumnType: false,
112
- };
113
- }
114
- /**
115
- * Build the final field type with array/nullable/Generated wrappers.
116
- */
117
- function buildFieldType(field, kyselyType, needsGenerated) {
118
- let baseType;
119
- // If complex type, wrap in ColumnType<S, I, U>
120
- if (kyselyType.needsColumnType && kyselyType.insertType && kyselyType.updateType) {
121
- baseType = ts.ref("ColumnType", [kyselyType.selectType, kyselyType.insertType, kyselyType.updateType]);
122
- }
123
- else {
124
- baseType = kyselyType.selectType;
125
- }
126
- // Wrap in array if needed
127
- if (field.isArray) {
128
- // For simple types, use T[]
129
- // For complex types, use ArrayType<T>
130
- if (kyselyType.needsColumnType) {
131
- baseType = ts.ref("ArrayType", [baseType]);
132
- }
133
- else {
134
- baseType = ts.array(baseType);
135
- }
136
- }
137
- // Wrap in nullable if needed
138
- if (field.nullable) {
139
- baseType = ts.nullable(baseType);
140
- }
141
- // Wrap in Generated<T> if field has default and is not insertable
142
- if (needsGenerated) {
143
- baseType = ts.ref("Generated", [baseType]);
144
- }
145
- return baseType;
146
- }
147
- /**
148
- * Determine if a field should be wrapped in Generated<T>.
149
- *
150
- * A field is Generated when:
151
- * - It has a default value, AND
152
- * - It's not required on insert (either auto-increment or RLS blocks insert)
153
- */
154
- function isGeneratedField(field) {
155
- if (!field.hasDefault)
156
- return false;
157
- // If field can't be inserted via RLS, it's generated
158
- if (!field.permissions.canInsert)
159
- return true;
160
- // Check for serial/identity columns (auto-incrementing)
161
- const pgType = field.pgAttribute.getType();
162
- if (!pgType)
163
- return false;
164
- // Check for identity columns (GENERATED ALWAYS AS IDENTITY)
165
- if (field.isIdentity)
166
- return true;
167
- // Check for generated columns (GENERATED ALWAYS AS ...)
168
- if (field.isGenerated)
169
- return true;
170
- // serial types have specific OIDs that resolve to int4/int8
171
- // but the attribute itself may have attidentity or atthasdef
172
- // For now, use a heuristic: if it's an integer with a default, likely generated
173
- const typeOid = Number(pgType._id);
174
- const isIntegerType = typeOid === PgTypeOid.Int2 || typeOid === PgTypeOid.Int4 || typeOid === PgTypeOid.Int8;
175
- // If it's an integer primary key with a default, it's likely auto-increment
176
- // This is a simplification - proper detection would check sequences
177
- if (isIntegerType && field.hasDefault) {
178
- // Check if it's a primary key (best effort)
179
- const constraints = field.pgAttribute.getClass()?.getConstraints() ?? [];
180
- const isPrimaryKey = constraints.some(c => c.contype === "p" && c.conkey?.includes(field.pgAttribute.attnum));
181
- if (isPrimaryKey)
182
- return true;
183
- }
184
- return false;
185
- }
186
- // ============================================================================
187
- // Statement Generators
188
- // ============================================================================
189
- /**
190
- * Generate enum type alias: `export type Status = "active" | "inactive"`
191
- */
192
- function generateEnumStatement(enumEntity) {
193
- return exp.typeAlias(enumEntity.name, { capability: "types:kysely", entity: enumEntity.name }, ts.union(...enumEntity.values.map(v => ts.literal(v))));
194
- }
195
- /**
196
- * Generate table interface with all column types.
197
- */
198
- function generateTableInterface(entity, ctx) {
199
- const properties = [];
200
- // Use the row shape for column definitions
201
- for (const field of entity.shapes.row.fields) {
202
- // Skip fields that aren't selectable via RLS
203
- if (!field.permissions.canSelect)
204
- continue;
205
- const kyselyType = resolveFieldType(field, ctx);
206
- const needsGenerated = isGeneratedField(field);
207
- const fieldType = buildFieldType(field, kyselyType, needsGenerated);
208
- properties.push({
209
- name: field.name,
210
- type: fieldType,
211
- });
212
- }
213
- return exp.interface(entity.name, { capability: "types:kysely", entity: entity.name }, properties);
214
- }
215
- /**
216
- * Generate composite type interface.
217
- *
218
- * Composite types are simpler than tables - they just have fields,
219
- * no shapes, no Generated wrapping (composites can't have defaults).
220
- */
221
- function generateCompositeInterface(composite, ctx) {
222
- const properties = [];
223
- for (const field of composite.fields) {
224
- const kyselyType = resolveFieldType(field, ctx);
225
- // Composites don't have Generated wrapping - they're just data structures
226
- const fieldType = buildFieldType(field, kyselyType, false);
227
- properties.push({
228
- name: field.name,
229
- type: fieldType,
230
- });
231
- }
232
- return exp.interface(composite.name, { capability: "types:kysely", entity: composite.name }, properties);
233
- }
234
- /**
235
- * Generate DB interface: `export interface DB { 'schema.table': Table }`
236
- */
237
- function generateDBInterface(entities, defaultSchemas) {
238
- const properties = [];
239
- for (const entity of entities) {
240
- // Skip entities that aren't selectable
241
- if (!entity.permissions.canSelect)
242
- continue;
243
- // Use schema-qualified key if not in default schema
244
- const key = defaultSchemas.includes(entity.schemaName)
245
- ? entity.pgName
246
- : `${entity.schemaName}.${entity.pgName}`;
247
- properties.push({
248
- name: key,
249
- type: ts.ref(entity.name),
250
- });
251
- }
252
- // Sort by key for stable output
253
- properties.sort((a, b) => a.name.localeCompare(b.name));
254
- return exp.interface("DB", { capability: "types:kysely", entity: "DB" }, properties);
255
- }
256
- function collectImports(entities, composites, ctx) {
257
- const kyselyImports = new Set();
258
- const externalImports = new Map();
259
- const usedEnums = new Set();
260
- let needsJsonTypes = false;
261
- let needsArrayType = false;
262
- let needsGenerated = false;
263
- // Helper to process a single field
264
- const processField = (field, schemaName, tableName, checkGenerated) => {
265
- const kyselyType = resolveFieldType(field, {
266
- ...ctx,
267
- schemaName,
268
- tableName,
269
- });
270
- // Check for ColumnType usage
271
- if (kyselyType.needsColumnType) {
272
- kyselyImports.add("ColumnType");
273
- }
274
- // Check for external imports
275
- if (kyselyType.externalImport) {
276
- const { name, from } = kyselyType.externalImport;
277
- if (!externalImports.has(from)) {
278
- externalImports.set(from, new Set());
279
- }
280
- externalImports.get(from).add(name);
281
- }
282
- // Check for enum usage
283
- if (isEnumType(field)) {
284
- const enumName = getPgTypeName(field);
285
- if (enumName) {
286
- const enumDef = findEnumByPgName(ctx.enums, enumName);
287
- if (Option.isSome(enumDef)) {
288
- usedEnums.add(enumDef.value.name);
289
- }
290
- }
291
- }
292
- // Check for JSON types
293
- const pgType = field.pgAttribute.getType();
294
- if (pgType?.typname === "json" || pgType?.typname === "jsonb") {
295
- needsJsonTypes = true;
296
- }
297
- // Check for complex array types
298
- if (field.isArray && kyselyType.needsColumnType) {
299
- needsArrayType = true;
300
- }
301
- // Check for Generated (only for table fields)
302
- if (checkGenerated && isGeneratedField(field)) {
303
- needsGenerated = true;
304
- }
305
- };
306
- // Process table entity fields
307
- for (const entity of entities) {
308
- if (!entity.permissions.canSelect)
309
- continue;
310
- for (const field of entity.shapes.row.fields) {
311
- if (!field.permissions.canSelect)
312
- continue;
313
- processField(field, entity.schemaName, entity.pgName, true);
314
- }
315
- }
316
- // Process composite entity fields
317
- for (const composite of composites) {
318
- for (const field of composite.fields) {
319
- processField(field, composite.schemaName, composite.pgName, false);
320
- }
321
- }
322
- return {
323
- kyselyImports,
324
- externalImports,
325
- usedEnums,
326
- needsJsonTypes,
327
- needsArrayType,
328
- needsGenerated,
329
- };
330
- }
331
- // ============================================================================
332
- // Core Generation Function
333
- // ============================================================================
334
- /**
335
- * Generate Kysely types from the IR.
336
- *
337
- * @param ctx - Plugin context for file emission and services
338
- * @param config - Types configuration (partial, defaults applied)
339
- */
340
- export function generateKyselyTypes(ctx, config = {}) {
341
- // Apply defaults
342
- const resolvedConfig = {
343
- ...defaultTypesConfig,
344
- ...config,
345
- };
346
- const { ir, typeHints } = ctx;
347
- const enumEntities = getEnumEntities(ir);
348
- const compositeEntities = getCompositeEntities(ir).filter(e => e.tags.omit !== true);
349
- const tableEntities = getTableEntities(ir).filter(e => e.tags.omit !== true);
350
- const defaultSchemas = ir.schemas;
351
- // Build field context
352
- const fieldCtx = {
353
- schemaName: "", // Will be set per-entity
354
- tableName: "",
355
- enums: enumEntities,
356
- composites: compositeEntities,
357
- extensions: ir.extensions,
358
- typeHints,
359
- defaultSchemas,
360
- };
361
- // Collect what imports we need
362
- const imports = collectImports(tableEntities, compositeEntities, fieldCtx);
363
- // Build statements
364
- const statements = [];
365
- // Generate enum types
366
- for (const enumEntity of enumEntities) {
367
- if (enumEntity.tags.omit === true)
368
- continue;
369
- statements.push(generateEnumStatement(enumEntity));
370
- }
371
- // Generate composite type interfaces
372
- for (const composite of compositeEntities) {
373
- statements.push(generateCompositeInterface(composite, {
374
- ...fieldCtx,
375
- schemaName: composite.schemaName,
376
- tableName: composite.pgName,
377
- }));
378
- }
379
- // Generate table interfaces
380
- for (const entity of tableEntities) {
381
- statements.push(generateTableInterface(entity, {
382
- ...fieldCtx,
383
- schemaName: entity.schemaName,
384
- tableName: entity.pgName,
385
- }));
386
- }
387
- // Generate DB interface
388
- statements.push(generateDBInterface(tableEntities, defaultSchemas));
389
- // Build the file
390
- const file = ctx.file(resolvedConfig.outputFile);
391
- // Add Kysely imports
392
- if (imports.kyselyImports.size > 0) {
393
- file.import({
394
- kind: "package",
395
- types: [...imports.kyselyImports],
396
- from: "kysely",
397
- });
398
- }
399
- // Add external imports
400
- for (const [from, names] of imports.externalImports) {
401
- file.import({
402
- kind: "relative",
403
- types: [...names],
404
- from,
405
- });
406
- }
407
- // Build header with helper types
408
- const helperTypes = [];
409
- if (imports.needsGenerated) {
410
- helperTypes.push(`export type Generated<T> = ${GENERATED_TYPE_DEF};`);
411
- }
412
- if (imports.needsArrayType) {
413
- helperTypes.push(`export type ArrayType<T> = ${ARRAY_TYPE_DEF};`);
414
- helperTypes.push(`export type ArrayTypeImpl<T> = ${ARRAY_TYPE_IMPL_DEF};`);
415
- }
416
- if (imports.needsJsonTypes) {
417
- helperTypes.push(`export type JsonPrimitive = boolean | number | string | null;`);
418
- helperTypes.push(`export type JsonObject = { [x: string]: JsonValue | undefined };`);
419
- helperTypes.push(`export type JsonArray = JsonValue[];`);
420
- helperTypes.push(`export type JsonValue = JsonArray | JsonObject | JsonPrimitive;`);
421
- }
422
- if (helperTypes.length > 0) {
423
- file.header(helperTypes.join("\n\n"));
424
- }
425
- // Add the main content
426
- file.ast(conjure.symbolProgram(...statements)).emit();
427
- }
428
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plugins/kysely/types.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAGrC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAQ/F,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAG9C,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,EACL,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAEpB,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,OAAO,CAAA;AAkB3B,4BAA4B;AAC5B,MAAM,CAAC,MAAM,kBAAkB,GAAsB;IACnD,UAAU,EAAE,OAAO;IACnB,YAAY,EAAE,KAAK;IACnB,eAAe,EAAE,IAAI;CACtB,CAAA;AA+BD,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E,sDAAsD;AACtD,MAAM,eAAe,GAAG,CAAC,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AAI,CAAC,sCAAsC,CAAC,CAAA;QACxD,WAAW,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAA;IACrF,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IACvC,CAAC;IAED,uBAAuB;IACvB,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;AACvD,CAAC"}
@@ -1,65 +0,0 @@
1
- /**
2
- * Artifact Store Service
3
- *
4
- * Provides plugin-to-plugin data passing via artifacts.
5
- * Plugins can store artifacts keyed by capability, and downstream
6
- * plugins can retrieve them.
7
- *
8
- * This service is stateful - created once per run and shared across plugins.
9
- */
10
- import { Context, Layer } from "effect";
11
- import type { Artifact, CapabilityKey } from "../ir/semantic-ir.js";
12
- /**
13
- * Artifact store interface
14
- */
15
- export interface ArtifactStoreImpl {
16
- /**
17
- * Get an artifact by exact capability key
18
- */
19
- readonly get: (capability: CapabilityKey) => Artifact | undefined;
20
- /**
21
- * Find an artifact by capability prefix.
22
- * Returns the first artifact whose capability starts with the given prefix.
23
- * Useful for finding "queries" regardless of whether it's "queries:sql" or "queries:kysely".
24
- *
25
- * @example
26
- * // Returns artifact from "queries:sql" or "queries:kysely"
27
- * store.find("queries")
28
- */
29
- readonly find: (capabilityPrefix: string) => Artifact | undefined;
30
- /**
31
- * Store an artifact for a capability
32
- * @param capability - The capability key
33
- * @param plugin - The plugin name (for attribution)
34
- * @param data - The artifact data
35
- */
36
- readonly set: (capability: CapabilityKey, plugin: string, data: unknown) => void;
37
- /**
38
- * Get all artifacts as a readonly map
39
- */
40
- readonly getAll: () => ReadonlyMap<CapabilityKey, Artifact>;
41
- }
42
- /**
43
- * Create a new artifact store instance.
44
- * Used by PluginRunner to create a single shared instance per run.
45
- */
46
- export declare function createArtifactStore(): ArtifactStoreImpl;
47
- declare const ArtifactStore_base: Context.TagClass<ArtifactStore, "ArtifactStore", ArtifactStoreImpl>;
48
- /**
49
- * ArtifactStore service tag
50
- *
51
- * Usage in plugins:
52
- * ```typescript
53
- * const store = yield* ArtifactStore
54
- * const prev = store.get("types")
55
- * store.set("schemas", pluginName, myData)
56
- * ```
57
- */
58
- export declare class ArtifactStore extends ArtifactStore_base {
59
- }
60
- /**
61
- * Live layer - creates a fresh artifact store
62
- */
63
- export declare const ArtifactStoreLive: Layer.Layer<ArtifactStore, never, never>;
64
- export {};
65
- //# sourceMappingURL=artifact-store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact-store.d.ts","sourceRoot":"","sources":["../../src/services/artifact-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAgB,OAAO,EAAE,KAAK,EAAgC,MAAM,QAAQ,CAAA;AACnF,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,aAAa,KAAK,QAAQ,GAAG,SAAS,CAAA;IAEjE;;;;;;;;OAQG;IACH,QAAQ,CAAC,IAAI,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAA;IAEjE;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAEhF;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,WAAW,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;CAC5D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,iBAAiB,CAmCvD;;AAED;;;;;;;;;GASG;AACH,qBAAa,aAAc,SAAQ,kBAGhC;CAAG;AAEN;;GAEG;AACH,eAAO,MAAM,iBAAiB,0CAAiD,CAAA"}
@@ -1,57 +0,0 @@
1
- /**
2
- * Artifact Store Service
3
- *
4
- * Provides plugin-to-plugin data passing via artifacts.
5
- * Plugins can store artifacts keyed by capability, and downstream
6
- * plugins can retrieve them.
7
- *
8
- * This service is stateful - created once per run and shared across plugins.
9
- */
10
- import { Array as Arr, Context, Layer, MutableHashMap, Option, pipe } from "effect";
11
- /**
12
- * Create a new artifact store instance.
13
- * Used by PluginRunner to create a single shared instance per run.
14
- */
15
- export function createArtifactStore() {
16
- const artifacts = MutableHashMap.empty();
17
- return {
18
- get: (capability) => Option.getOrUndefined(MutableHashMap.get(artifacts, capability)),
19
- find: (capabilityPrefix) => {
20
- // Find first artifact whose capability matches prefix exactly or starts with "prefix:"
21
- for (const [key, value] of artifacts) {
22
- if (key === capabilityPrefix || key.startsWith(`${capabilityPrefix}:`)) {
23
- return value;
24
- }
25
- }
26
- return undefined;
27
- },
28
- set: (capability, plugin, data) => {
29
- MutableHashMap.set(artifacts, capability, {
30
- capability,
31
- plugin,
32
- data,
33
- });
34
- },
35
- getAll: () => pipe([...artifacts], Arr.reduce(new Map(), (map, [key, value]) => {
36
- map.set(key, value);
37
- return map;
38
- }), (map) => map),
39
- };
40
- }
41
- /**
42
- * ArtifactStore service tag
43
- *
44
- * Usage in plugins:
45
- * ```typescript
46
- * const store = yield* ArtifactStore
47
- * const prev = store.get("types")
48
- * store.set("schemas", pluginName, myData)
49
- * ```
50
- */
51
- export class ArtifactStore extends Context.Tag("ArtifactStore")() {
52
- }
53
- /**
54
- * Live layer - creates a fresh artifact store
55
- */
56
- export const ArtifactStoreLive = Layer.sync(ArtifactStore, createArtifactStore);
57
- //# sourceMappingURL=artifact-store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifact-store.js","sourceRoot":"","sources":["../../src/services/artifact-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KA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,aAAc,SAAQ,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAG5D;CAAG;AAEN;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,mBAAmB,CAAC,CAAA"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Core Providers
3
- *
4
- * Built-in providers that other providers depend on.
5
- */
6
- import { type Plugin } from "./plugin.js";
7
- import type { SemanticIR } from "../ir/semantic-ir.js";
8
- /**
9
- * Semantic IR Provider
10
- *
11
- * Singleton provider that supplies the built IR to other providers.
12
- * The IR is passed in at construction time (built by generate.ts).
13
- */
14
- export declare function createSemanticIRProvider(ir: SemanticIR): Plugin<Record<string, never>, SemanticIR>;
15
- //# sourceMappingURL=core-providers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-providers.d.ts","sourceRoot":"","sources":["../../src/services/core-providers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEtD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,CAAC,CAWlG"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Core Providers
3
- *
4
- * Built-in providers that other providers depend on.
5
- */
6
- import { definePlugin } from "./plugin.js";
7
- /**
8
- * Semantic IR Provider
9
- *
10
- * Singleton provider that supplies the built IR to other providers.
11
- * The IR is passed in at construction time (built by generate.ts).
12
- */
13
- export function createSemanticIRProvider(ir) {
14
- return definePlugin({
15
- name: "semantic-ir",
16
- kind: "semantic-ir",
17
- singleton: true,
18
- singletonParams: {},
19
- canProvide: () => true,
20
- provide: () => ir,
21
- });
22
- }
23
- //# sourceMappingURL=core-providers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"core-providers.js","sourceRoot":"","sources":["../../src/services/core-providers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAe,MAAM,aAAa,CAAA;AAGvD;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,EAAc;IACrD,OAAO,YAAY,CAAC;QAClB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,IAAI;QACf,eAAe,EAAE,EAAE;QAEnB,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI;QAEtB,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KAClB,CAAC,CAAA;AACJ,CAAC"}