postgresdk 0.18.0 → 0.18.1

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
@@ -3583,12 +3583,16 @@ function emitClient(table, graph, opts, model) {
3583
3583
  const paramName = toIncludeParamName(key);
3584
3584
  includeParamNames.push(paramName);
3585
3585
  paramsType = `{
3586
+ select?: string[];
3587
+ exclude?: string[];
3586
3588
  limit?: number;
3587
3589
  offset?: number;
3588
3590
  where?: Where<Select${Type}>;
3589
3591
  orderBy?: string | string[];
3590
3592
  order?: "asc" | "desc" | ("asc" | "desc")[];
3591
3593
  ${paramName}?: {
3594
+ select?: string[];
3595
+ exclude?: string[];
3592
3596
  orderBy?: string | string[];
3593
3597
  order?: "asc" | "desc";
3594
3598
  limit?: number;
@@ -3601,6 +3605,8 @@ function emitClient(table, graph, opts, model) {
3601
3605
  const paramName = toIncludeParamName(key);
3602
3606
  includeParamNames.push(paramName);
3603
3607
  return `${paramName}?: {
3608
+ select?: string[];
3609
+ exclude?: string[];
3604
3610
  orderBy?: string | string[];
3605
3611
  order?: "asc" | "desc";
3606
3612
  limit?: number;
@@ -3609,6 +3615,8 @@ function emitClient(table, graph, opts, model) {
3609
3615
  }).join(`;
3610
3616
  `);
3611
3617
  paramsType = `{
3618
+ select?: string[];
3619
+ exclude?: string[];
3612
3620
  limit?: number;
3613
3621
  offset?: number;
3614
3622
  where?: Where<Select${Type}>;
@@ -3620,12 +3628,16 @@ function emitClient(table, graph, opts, model) {
3620
3628
  const paramName = toIncludeParamName(pattern.nestedKey);
3621
3629
  includeParamNames.push(paramName);
3622
3630
  paramsType = `{
3631
+ select?: string[];
3632
+ exclude?: string[];
3623
3633
  limit?: number;
3624
3634
  offset?: number;
3625
3635
  where?: Where<Select${Type}>;
3626
3636
  orderBy?: string | string[];
3627
3637
  order?: "asc" | "desc" | ("asc" | "desc")[];
3628
3638
  ${paramName}?: {
3639
+ select?: string[];
3640
+ exclude?: string[];
3629
3641
  orderBy?: string | string[];
3630
3642
  order?: "asc" | "desc";
3631
3643
  limit?: number;
@@ -3669,12 +3681,14 @@ function emitClient(table, graph, opts, model) {
3669
3681
  /**
3670
3682
  * Get a ${table.name} record by primary key with included related ${relationshipDesc}
3671
3683
  * @param pk - The primary key value${hasCompositePk ? "s" : ""}
3672
- * @param params - Optional include options
3684
+ * @param params - Optional include options (including select/exclude for base and nested tables)
3673
3685
  * @returns The record with nested ${method.path.join(" and ")} if found, null otherwise
3674
3686
  */
3675
3687
  async ${method.name}(pk: ${pkType}, params?: ${paramsType}): Promise<${method.returnType}> {${transformCode}
3676
3688
  const results = await this.post<PaginatedResponse<${baseReturnType}>>(\`\${this.resource}/list\`, {
3677
3689
  where: ${pkWhere},
3690
+ select: params?.select,
3691
+ exclude: params?.exclude,
3678
3692
  include: includeSpec,
3679
3693
  limit: 1
3680
3694
  });
package/dist/index.js CHANGED
@@ -2604,12 +2604,16 @@ function emitClient(table, graph, opts, model) {
2604
2604
  const paramName = toIncludeParamName(key);
2605
2605
  includeParamNames.push(paramName);
2606
2606
  paramsType = `{
2607
+ select?: string[];
2608
+ exclude?: string[];
2607
2609
  limit?: number;
2608
2610
  offset?: number;
2609
2611
  where?: Where<Select${Type}>;
2610
2612
  orderBy?: string | string[];
2611
2613
  order?: "asc" | "desc" | ("asc" | "desc")[];
2612
2614
  ${paramName}?: {
2615
+ select?: string[];
2616
+ exclude?: string[];
2613
2617
  orderBy?: string | string[];
2614
2618
  order?: "asc" | "desc";
2615
2619
  limit?: number;
@@ -2622,6 +2626,8 @@ function emitClient(table, graph, opts, model) {
2622
2626
  const paramName = toIncludeParamName(key);
2623
2627
  includeParamNames.push(paramName);
2624
2628
  return `${paramName}?: {
2629
+ select?: string[];
2630
+ exclude?: string[];
2625
2631
  orderBy?: string | string[];
2626
2632
  order?: "asc" | "desc";
2627
2633
  limit?: number;
@@ -2630,6 +2636,8 @@ function emitClient(table, graph, opts, model) {
2630
2636
  }).join(`;
2631
2637
  `);
2632
2638
  paramsType = `{
2639
+ select?: string[];
2640
+ exclude?: string[];
2633
2641
  limit?: number;
2634
2642
  offset?: number;
2635
2643
  where?: Where<Select${Type}>;
@@ -2641,12 +2649,16 @@ function emitClient(table, graph, opts, model) {
2641
2649
  const paramName = toIncludeParamName(pattern.nestedKey);
2642
2650
  includeParamNames.push(paramName);
2643
2651
  paramsType = `{
2652
+ select?: string[];
2653
+ exclude?: string[];
2644
2654
  limit?: number;
2645
2655
  offset?: number;
2646
2656
  where?: Where<Select${Type}>;
2647
2657
  orderBy?: string | string[];
2648
2658
  order?: "asc" | "desc" | ("asc" | "desc")[];
2649
2659
  ${paramName}?: {
2660
+ select?: string[];
2661
+ exclude?: string[];
2650
2662
  orderBy?: string | string[];
2651
2663
  order?: "asc" | "desc";
2652
2664
  limit?: number;
@@ -2690,12 +2702,14 @@ function emitClient(table, graph, opts, model) {
2690
2702
  /**
2691
2703
  * Get a ${table.name} record by primary key with included related ${relationshipDesc}
2692
2704
  * @param pk - The primary key value${hasCompositePk ? "s" : ""}
2693
- * @param params - Optional include options
2705
+ * @param params - Optional include options (including select/exclude for base and nested tables)
2694
2706
  * @returns The record with nested ${method.path.join(" and ")} if found, null otherwise
2695
2707
  */
2696
2708
  async ${method.name}(pk: ${pkType}, params?: ${paramsType}): Promise<${method.returnType}> {${transformCode}
2697
2709
  const results = await this.post<PaginatedResponse<${baseReturnType}>>(\`\${this.resource}/list\`, {
2698
2710
  where: ${pkWhere},
2711
+ select: params?.select,
2712
+ exclude: params?.exclude,
2699
2713
  include: includeSpec,
2700
2714
  limit: 1
2701
2715
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postgresdk",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Generate a typed server/client SDK from a Postgres schema (includes, Zod, Hono).",
5
5
  "type": "module",
6
6
  "bin": {