@simplysm/orm-common 14.0.42 → 14.0.43

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.
@@ -425,7 +425,7 @@ export class PostgresqlQueryBuilder extends QueryBuilderBase {
425
425
  colSql += " GENERATED BY DEFAULT AS IDENTITY";
426
426
  }
427
427
 
428
- if (col.default !== undefined) {
428
+ if (col.default != null) {
429
429
  colSql += ` DEFAULT ${this.expr.escapeValue(col.default)}`;
430
430
  }
431
431
 
@@ -478,7 +478,7 @@ export class PostgresqlQueryBuilder extends QueryBuilderBase {
478
478
  colSql += " GENERATED BY DEFAULT AS IDENTITY";
479
479
  }
480
480
 
481
- if (col.default !== undefined) {
481
+ if (col.default != null) {
482
482
  colSql += ` DEFAULT ${this.expr.escapeValue(col.default)}`;
483
483
  }
484
484
 
@@ -511,7 +511,7 @@ export class PostgresqlQueryBuilder extends QueryBuilderBase {
511
511
  }
512
512
 
513
513
  // DEFAULT 변경
514
- if (col.default !== undefined) {
514
+ if (col.default != null) {
515
515
  parts.push(
516
516
  `ALTER COLUMN ${this.expr.wrap(col.name)} SET DEFAULT ${this.expr.escapeValue(col.default)}`,
517
517
  );
@@ -604,7 +604,7 @@ export class PostgresqlQueryBuilder extends QueryBuilderBase {
604
604
  def.params
605
605
  ?.map((p) => {
606
606
  let sql = `${this.expr.wrap(p.name)} ${this.expr.renderDataType(p.dataType)}`;
607
- if (p.default !== undefined) {
607
+ if (p.default != null) {
608
608
  sql += ` DEFAULT ${this.expr.escapeValue(p.default)}`;
609
609
  }
610
610
  return sql;
@@ -97,7 +97,7 @@ function flatToNested(
97
97
  const parsedValue = parseValue(rawValue, type);
98
98
 
99
99
  // undefined 값은 key로 추가하지 않음
100
- if (parsedValue === undefined) continue;
100
+ if (parsedValue == null) continue;
101
101
 
102
102
  if (parts != null) {
103
103
  // 중첩 key: "posts.id" → { posts: { id: ... } }