postgresdk 0.6.10 → 0.6.11

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/cli.js CHANGED
@@ -1015,10 +1015,11 @@ function emitZod(table, opts) {
1015
1015
  };
1016
1016
  const fields = table.columns.map((c) => {
1017
1017
  let z = zFor(c.pgType);
1018
- if (c.nullable)
1019
- z += `.nullable()`;
1020
- if (c.hasDefault)
1018
+ if (c.nullable) {
1019
+ z += `.nullish()`;
1020
+ } else if (c.hasDefault) {
1021
1021
  z += `.optional()`;
1022
+ }
1022
1023
  return ` ${c.name}: ${z}`;
1023
1024
  }).join(`,
1024
1025
  `);
package/dist/index.js CHANGED
@@ -752,10 +752,11 @@ function emitZod(table, opts) {
752
752
  };
753
753
  const fields = table.columns.map((c) => {
754
754
  let z = zFor(c.pgType);
755
- if (c.nullable)
756
- z += `.nullable()`;
757
- if (c.hasDefault)
755
+ if (c.nullable) {
756
+ z += `.nullish()`;
757
+ } else if (c.hasDefault) {
758
758
  z += `.optional()`;
759
+ }
759
760
  return ` ${c.name}: ${z}`;
760
761
  }).join(`,
761
762
  `);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postgresdk",
3
- "version": "0.6.10",
3
+ "version": "0.6.11",
4
4
  "description": "Generate a typed server/client SDK from a Postgres schema (includes, Zod, Hono).",
5
5
  "type": "module",
6
6
  "bin": {