postgresdk 0.15.2 → 0.15.3

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/README.md CHANGED
@@ -588,9 +588,7 @@ const books = booksResult.data;
588
588
  const nestedResult = await sdk.authors.list({
589
589
  include: {
590
590
  books: {
591
- include: {
592
- tags: true
593
- }
591
+ tags: true
594
592
  }
595
593
  }
596
594
  });
package/dist/cli.js CHANGED
@@ -2688,7 +2688,7 @@ export function buildWith(root: TableName, spec: any, maxDepth = ${maxDepth}) {
2688
2688
  const v = s[key];
2689
2689
  if (v === true) out[key] = true;
2690
2690
  else if (v && typeof v === "object") {
2691
- const child = "include" in v ? walk(rel.target, v.include, depth + 1) : undefined;
2691
+ const child = walk(rel.target, v, depth + 1);
2692
2692
  out[key] = child ? { with: child } : true;
2693
2693
  }
2694
2694
  }
@@ -3581,7 +3581,7 @@ export async function loadIncludes(
3581
3581
  for (const r of rows) r[key] = [];
3582
3582
  }
3583
3583
  // Recurse if nested include specified
3584
- const childSpec = s[key] && typeof s[key] === "object" ? (s[key] as any).include : undefined;
3584
+ const childSpec = s[key] && typeof s[key] === "object" ? s[key] : undefined;
3585
3585
  if (childSpec) {
3586
3586
  const children = rows.flatMap(r => (r[key] ?? []));
3587
3587
  try {
@@ -3601,7 +3601,7 @@ export async function loadIncludes(
3601
3601
  log.error("loadOneToMany failed", { table, key, target }, e?.message ?? e);
3602
3602
  for (const r of rows) r[key] = [];
3603
3603
  }
3604
- const childSpec = s[key] && typeof s[key] === "object" ? (s[key] as any).include : undefined;
3604
+ const childSpec = s[key] && typeof s[key] === "object" ? s[key] : undefined;
3605
3605
  if (childSpec) {
3606
3606
  const children = rows.flatMap(r => (r[key] ?? []));
3607
3607
  try {
@@ -3630,7 +3630,7 @@ export async function loadIncludes(
3630
3630
  for (const r of rows) r[key] = null;
3631
3631
  }
3632
3632
  }
3633
- const childSpec = s[key] && typeof s[key] === "object" ? (s[key] as any).include : undefined;
3633
+ const childSpec = s[key] && typeof s[key] === "object" ? s[key] : undefined;
3634
3634
  if (childSpec) {
3635
3635
  const children = rows.map(r => r[key]).filter(Boolean);
3636
3636
  try {
package/dist/index.js CHANGED
@@ -1862,7 +1862,7 @@ export function buildWith(root: TableName, spec: any, maxDepth = ${maxDepth}) {
1862
1862
  const v = s[key];
1863
1863
  if (v === true) out[key] = true;
1864
1864
  else if (v && typeof v === "object") {
1865
- const child = "include" in v ? walk(rel.target, v.include, depth + 1) : undefined;
1865
+ const child = walk(rel.target, v, depth + 1);
1866
1866
  out[key] = child ? { with: child } : true;
1867
1867
  }
1868
1868
  }
@@ -2755,7 +2755,7 @@ export async function loadIncludes(
2755
2755
  for (const r of rows) r[key] = [];
2756
2756
  }
2757
2757
  // Recurse if nested include specified
2758
- const childSpec = s[key] && typeof s[key] === "object" ? (s[key] as any).include : undefined;
2758
+ const childSpec = s[key] && typeof s[key] === "object" ? s[key] : undefined;
2759
2759
  if (childSpec) {
2760
2760
  const children = rows.flatMap(r => (r[key] ?? []));
2761
2761
  try {
@@ -2775,7 +2775,7 @@ export async function loadIncludes(
2775
2775
  log.error("loadOneToMany failed", { table, key, target }, e?.message ?? e);
2776
2776
  for (const r of rows) r[key] = [];
2777
2777
  }
2778
- const childSpec = s[key] && typeof s[key] === "object" ? (s[key] as any).include : undefined;
2778
+ const childSpec = s[key] && typeof s[key] === "object" ? s[key] : undefined;
2779
2779
  if (childSpec) {
2780
2780
  const children = rows.flatMap(r => (r[key] ?? []));
2781
2781
  try {
@@ -2804,7 +2804,7 @@ export async function loadIncludes(
2804
2804
  for (const r of rows) r[key] = null;
2805
2805
  }
2806
2806
  }
2807
- const childSpec = s[key] && typeof s[key] === "object" ? (s[key] as any).include : undefined;
2807
+ const childSpec = s[key] && typeof s[key] === "object" ? s[key] : undefined;
2808
2808
  if (childSpec) {
2809
2809
  const children = rows.map(r => r[key]).filter(Boolean);
2810
2810
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postgresdk",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "Generate a typed server/client SDK from a Postgres schema (includes, Zod, Hono).",
5
5
  "type": "module",
6
6
  "bin": {