postgresdk 0.18.29 → 0.19.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.
package/dist/types.d.ts CHANGED
@@ -15,6 +15,14 @@ export type AuthConfigInput = AuthConfig | {
15
15
  apiKeys?: string[];
16
16
  apiKeyHeader?: string;
17
17
  };
18
+ export interface DeleteConfig {
19
+ /** Column name for soft deletes (e.g. "deleted_at"). Absence = hard deletes only. */
20
+ softDeleteColumn?: string;
21
+ /** Whether to also expose hardDelete when soft delete is configured. @default true */
22
+ exposeHardDelete?: boolean;
23
+ /** Per-table overrides. Use null to disable soft delete for a specific table. */
24
+ softDeleteColumnOverrides?: Record<string, string | null>;
25
+ }
18
26
  export interface Config {
19
27
  connectionString: string;
20
28
  schema?: string;
@@ -22,9 +30,8 @@ export interface Config {
22
30
  client: string;
23
31
  server: string;
24
32
  };
25
- softDeleteColumn?: string | null;
26
- /** Per-table overrides for soft delete column. Use `null` to disable soft deletes for a specific table. */
27
- softDeleteColumnOverrides?: Record<string, string | null>;
33
+ /** Delete configuration (soft/hard delete behavior). */
34
+ delete?: DeleteConfig;
28
35
  dateType?: "date" | "string";
29
36
  numericMode?: "string" | "number" | "auto";
30
37
  includeMethodsDepth?: number;
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /** Returns true if the pg type is a vector/embedding type */
2
+ export declare function isVectorType(pgType: string): boolean;
3
+ /** Returns true if the pg type is JSON/JSONB */
4
+ export declare function isJsonbType(pgType: string): boolean;
1
5
  export declare const pascal: (s: string) => string;
2
6
  export declare function writeFiles(files: Array<{
3
7
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postgresdk",
3
- "version": "0.18.29",
3
+ "version": "0.19.0",
4
4
  "description": "Generate a typed server/client SDK from a Postgres schema (includes, Zod, Hono).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "scripts": {
24
24
  "build": "bun build src/cli.ts src/index.ts --outdir dist --target node --format esm --external=pg --external=zod --external=hono --external=prompts --external=node:* && tsc -p tsconfig.build.json --emitDeclarationOnly",
25
- "test": "bun test:write-files && bun test:init && bun test:gen && bun test test/test-where-clause.test.ts && bun test test/test-where-or-and.test.ts && bun test test/test-nested-include-options.test.ts && bun test test/test-include-methods-with-options.test.ts && bun test:gen-with-tests && bun test:pull && bun test:enums && bun test:typecheck && bun test:drizzle-e2e && bun test test/test-numeric-mode-integration.test.ts && bun test test/test-jsonb-array-serialization.test.ts && bun test test/test-trigram-search.test.ts && bun test test/test-soft-delete-config.test.ts && bun test test/test-soft-delete-include-loader.test.ts && bun test test/test-soft-delete-nested-include.test.ts",
25
+ "test": "bun test:write-files && bun test:init && bun test:gen && bun test test/test-where-clause.test.ts && bun test test/test-where-or-and.test.ts && bun test test/test-nested-include-options.test.ts && bun test test/test-include-methods-with-options.test.ts && bun test:gen-with-tests && bun test:pull && bun test:enums && bun test:typecheck && bun test:drizzle-e2e && bun test test/test-numeric-mode-integration.test.ts && bun test test/test-jsonb-array-serialization.test.ts && bun test test/test-trigram-search.test.ts && bun test test/test-soft-delete-config.test.ts && bun test test/test-soft-delete-include-loader.test.ts && bun test test/test-soft-delete-nested-include.test.ts && bun test test/test-transaction.test.ts",
26
26
  "test:write-files": "bun test/test-write-files-if-changed.ts",
27
27
  "test:init": "bun test/test-init.ts",
28
28
  "test:gen": "bun test/test-gen.ts",