sonamu 0.10.6 → 0.10.7
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/api/base-frame.d.ts +2 -0
- package/dist/api/base-frame.d.ts.map +1 -1
- package/dist/api/base-frame.js +8 -1
- package/dist/api/decorators.js +1 -1
- package/dist/api/sonamu.js +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/database/base-model.js +2 -2
- package/dist/entity/entity-manager.js +1 -1
- package/dist/index.js +3 -3
- package/dist/migration/migrator.js +1 -1
- package/dist/migration/slack-confirm.js +1 -1
- package/dist/naite/naite-reporter.js +1 -1
- package/dist/syncer/checksum.js +1 -1
- package/dist/syncer/code-generator.js +1 -1
- package/dist/syncer/entity-operations.js +1 -1
- package/dist/syncer/syncer-actions.js +1 -1
- package/dist/syncer/syncer.js +1 -1
- package/dist/utils/formatter.js +1 -1
- package/package.json +4 -4
- package/src/api/base-frame.ts +14 -1
package/dist/api/base-frame.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { type Logger } from "@logtape/logtape";
|
|
2
2
|
import { type Knex } from "knex";
|
|
3
3
|
import { type DBPreset } from "../database/db";
|
|
4
|
+
import { PuriWrapper } from "../database/puri-wrapper";
|
|
4
5
|
import { UpsertBuilder } from "../database/upsert-builder";
|
|
5
6
|
export declare abstract class BaseFrameClass {
|
|
6
7
|
readonly frameName: string;
|
|
7
8
|
protected readonly logger: Logger;
|
|
8
9
|
constructor(frameName?: string);
|
|
9
10
|
getDB(which: DBPreset): Knex;
|
|
11
|
+
getPuri(which: DBPreset): PuriWrapper;
|
|
10
12
|
getUpsertBuilder(): UpsertBuilder;
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=base-frame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-frame.d.ts","sourceRoot":"","sources":["../../src/api/base-frame.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,8BAAsB,cAAc;aAGN,SAAS,EAAE,MAAM;IAF7C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEN,SAAS,GAAE,MAA8B;IAIrE,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI5B,gBAAgB;CAGjB"}
|
|
1
|
+
{"version":3,"file":"base-frame.d.ts","sourceRoot":"","sources":["../../src/api/base-frame.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,8BAAsB,cAAc;aAGN,SAAS,EAAE,MAAM;IAF7C,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEN,SAAS,GAAE,MAA8B;IAIrE,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI5B,OAAO,CAAC,KAAK,EAAE,QAAQ,GAAG,WAAW;IAYrC,gBAAgB;CAGjB"}
|
package/dist/api/base-frame.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { __esmMin } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { convertDomainToCategory, init_category } from "../logger/category.js";
|
|
3
3
|
import { DB, init_db } from "../database/db.js";
|
|
4
|
+
import { PuriWrapper, init_puri_wrapper } from "../database/puri-wrapper.js";
|
|
4
5
|
import { UpsertBuilder, init_upsert_builder } from "../database/upsert-builder.js";
|
|
5
6
|
import { getLogger } from "@logtape/logtape";
|
|
6
7
|
//#region src/api/base-frame.ts
|
|
7
8
|
var BaseFrameClass;
|
|
8
9
|
var init_base_frame = __esmMin((() => {
|
|
9
10
|
init_db();
|
|
11
|
+
init_puri_wrapper();
|
|
10
12
|
init_upsert_builder();
|
|
11
13
|
init_category();
|
|
12
14
|
BaseFrameClass = class {
|
|
@@ -19,6 +21,11 @@ var init_base_frame = __esmMin((() => {
|
|
|
19
21
|
getDB(which) {
|
|
20
22
|
return DB.getDB(which);
|
|
21
23
|
}
|
|
24
|
+
getPuri(which) {
|
|
25
|
+
const trx = DB.getTransactionContext().getTransaction(which);
|
|
26
|
+
if (trx) return trx;
|
|
27
|
+
return new PuriWrapper(this.getDB(which), new UpsertBuilder());
|
|
28
|
+
}
|
|
22
29
|
getUpsertBuilder() {
|
|
23
30
|
return new UpsertBuilder();
|
|
24
31
|
}
|
|
@@ -28,4 +35,4 @@ var init_base_frame = __esmMin((() => {
|
|
|
28
35
|
init_base_frame();
|
|
29
36
|
export { BaseFrameClass, init_base_frame };
|
|
30
37
|
|
|
31
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
38
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS1mcmFtZS5qcyIsIm5hbWVzIjpbXSwic291cmNlcyI6WyIuLi8uLi9zcmMvYXBpL2Jhc2UtZnJhbWUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZ2V0TG9nZ2VyIH0gZnJvbSBcIkBsb2d0YXBlL2xvZ3RhcGVcIjtcbmltcG9ydCB7IHR5cGUgTG9nZ2VyIH0gZnJvbSBcIkBsb2d0YXBlL2xvZ3RhcGVcIjtcbmltcG9ydCB7IHR5cGUgS25leCB9IGZyb20gXCJrbmV4XCI7XG5cbmltcG9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ainToCategory, init_category } from "../logger/category.js";
|
|
3
3
|
import { getModelNameFromClassName, init_class_name } from "../utils/class-name.js";
|
|
4
4
|
import { DB, init_db } from "../database/db.js";
|
|
5
|
+
import { PuriTransactionWrapper, init_puri_wrapper } from "../database/puri-wrapper.js";
|
|
5
6
|
import { UpsertBuilder, init_upsert_builder } from "../database/upsert-builder.js";
|
|
6
7
|
import { BaseFrameClass, init_base_frame } from "./base-frame.js";
|
|
7
|
-
import { PuriTransactionWrapper, init_puri_wrapper } from "../database/puri-wrapper.js";
|
|
8
8
|
import { BaseModelClass, init_base_model } from "../database/base-model.js";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import inflection from "inflection";
|
package/dist/api/sonamu.js
CHANGED
|
@@ -20,8 +20,8 @@ import { createWebSocketReplyStub, init_websocket_helpers, resolveIntegratedVite
|
|
|
20
20
|
import { AsyncLocalStorage } from "async_hooks";
|
|
21
21
|
import { dispose } from "@logtape/logtape";
|
|
22
22
|
import path from "path";
|
|
23
|
-
import fs from "fs/promises";
|
|
24
23
|
import chalk from "chalk";
|
|
24
|
+
import fs from "fs/promises";
|
|
25
25
|
import os from "os";
|
|
26
26
|
import mime, { lookup } from "mime-types";
|
|
27
27
|
//#region src/api/sonamu.ts
|
package/dist/bin/cli.js
CHANGED
|
@@ -15,8 +15,8 @@ import { testCommand } from "./test-command.js";
|
|
|
15
15
|
import assert from "assert";
|
|
16
16
|
import path from "path";
|
|
17
17
|
import knex from "knex";
|
|
18
|
-
import { cp, mkdir, readFile, readdir, readlink, realpath, rm, symlink, writeFile } from "fs/promises";
|
|
19
18
|
import chalk from "chalk";
|
|
19
|
+
import { cp, mkdir, readFile, readdir, readlink, realpath, rm, symlink, writeFile } from "fs/promises";
|
|
20
20
|
import os from "os";
|
|
21
21
|
import { execSync, spawn } from "child_process";
|
|
22
22
|
import { createRequire } from "module";
|
|
@@ -3,11 +3,11 @@ import { convertDomainToCategory, init_category } from "../logger/category.js";
|
|
|
3
3
|
import { DB, init_db } from "./db.js";
|
|
4
4
|
import { Sonamu, init_sonamu } from "../api/sonamu.js";
|
|
5
5
|
import { EntityManager, init_entity_manager } from "../entity/entity-manager.js";
|
|
6
|
+
import { Puri, init_puri } from "./puri.js";
|
|
7
|
+
import { PuriWrapper, init_puri_wrapper } from "./puri-wrapper.js";
|
|
6
8
|
import { UpsertBuilder, init_upsert_builder } from "./upsert-builder.js";
|
|
7
9
|
import { init_utils, normalizeFilterQuery, validateSonamuFilters } from "../filter/utils.js";
|
|
8
10
|
import { getJoinTables, getTableNamesFromWhere, init_sql_parser } from "../utils/sql-parser.js";
|
|
9
|
-
import { Puri, init_puri } from "./puri.js";
|
|
10
|
-
import { PuriWrapper, init_puri_wrapper } from "./puri-wrapper.js";
|
|
11
11
|
import { getLogger } from "@logtape/logtape";
|
|
12
12
|
import { cloneDeep, cluster, group, isObject, omit, set } from "radashi";
|
|
13
13
|
//#region src/database/base-model.ts
|
|
@@ -8,8 +8,8 @@ import inflection from "inflection";
|
|
|
8
8
|
import { prettifyError, z as z$1 } from "zod";
|
|
9
9
|
import assert from "assert";
|
|
10
10
|
import path from "path";
|
|
11
|
-
import { glob, readFile } from "fs/promises";
|
|
12
11
|
import chalk from "chalk";
|
|
12
|
+
import { glob, readFile } from "fs/promises";
|
|
13
13
|
//#region src/entity/entity-manager.ts
|
|
14
14
|
var EntityManagerClass, EntityManager;
|
|
15
15
|
var init_entity_manager = __esmMin((() => {
|
package/dist/index.js
CHANGED
|
@@ -17,14 +17,14 @@ import { Sonamu, init_sonamu } from "./api/sonamu.js";
|
|
|
17
17
|
import { ApiParamType, BUILT_IN_TYPE_IDS, EntityJsonSchema, GenerateOptions, KnownOpclassValues, NormalPropSchema, PathAndCode, RelationPropSchema, RenderingNode, SonamuFileArraySchema, SonamuFileSchema, SonamuQueryMode, SonamuSemanticParams, TemplateKey, TemplateOptions, ZodStringFormat, getDescription, getEnumDefValues, getSubsetFields, init_types, isBelongsToOneRelationProp, isBigIntegerArrayProp, isBigIntegerProp, isBigIntegerSingleProp, isBooleanArrayProp, isBooleanProp, isBooleanSingleProp, isCustomJoinClause, isDateArrayProp, isDateProp, isDateSingleProp, isEnumArrayProp, isEnumDefWithCone, isEnumProp, isEnumSingleProp, isHasManyRelationProp, isIntegerArrayProp, isIntegerProp, isIntegerSingleProp, isInternalSubsetField, isJsonProp, isKnexError, isManyToManyRelationProp, isNumberArrayProp, isNumberProp, isNumberSingleProp, isNumericArrayProp, isNumericProp, isNumericSingleProp, isOneToOneRelationProp, isRelationProp, isSearchTextJsonSourceZodType, isSearchTextProp, isStringArrayProp, isStringProp, isStringSingleProp, isSubsetDefWithCone, isTsVectorProp, isUuidArrayProp, isUuidProp, isUuidSingleProp, isVectorArrayProp, isVectorProp, isVectorSingleProp, isVirtualCodeProp, isVirtualProp, isVirtualQueryProp, normalizeSubsetField, zArrayable } from "./types/types.js";
|
|
18
18
|
import { EntityManager, init_entity_manager } from "./entity/entity-manager.js";
|
|
19
19
|
import { Naite, NaiteClass, NaiteQuery, init_naite } from "./naite/naite.js";
|
|
20
|
+
import { FUZZY_OPERATORS, init_puri_types } from "./database/puri.types.js";
|
|
21
|
+
import { JoinClauseGroup, Puri, ResolvedPuri, WhereGroup, init_puri } from "./database/puri.js";
|
|
22
|
+
import { PuriTransactionWrapper, PuriWrapper, init_puri_wrapper } from "./database/puri-wrapper.js";
|
|
20
23
|
import { UpsertBuilder, init_upsert_builder, isRefField } from "./database/upsert-builder.js";
|
|
21
24
|
import { BaseFrameClass, init_base_frame } from "./api/base-frame.js";
|
|
22
25
|
import { defineConfig, init_config, loadConfig } from "./api/config.js";
|
|
23
26
|
import { defaultOperatorByPropType, init_types as init_types$1, operatorsByPropType } from "./filter/types.js";
|
|
24
27
|
import { getEnumValues, init_utils as init_utils$1, normalizeFilterQuery, validateSonamuFilters } from "./filter/utils.js";
|
|
25
|
-
import { FUZZY_OPERATORS, init_puri_types } from "./database/puri.types.js";
|
|
26
|
-
import { JoinClauseGroup, Puri, ResolvedPuri, WhereGroup, init_puri } from "./database/puri.js";
|
|
27
|
-
import { PuriTransactionWrapper, PuriWrapper, init_puri_wrapper } from "./database/puri-wrapper.js";
|
|
28
28
|
import { BaseModel, BaseModelClass, init_base_model } from "./database/base-model.js";
|
|
29
29
|
import { api, init_decorators, registeredApis, stream, transactional, upload, websocket } from "./api/decorators.js";
|
|
30
30
|
import { ingestAuditEvent } from "./auth/audit-log-ingestor.js";
|
|
@@ -15,8 +15,8 @@ import { getMigrationSetFromEntity, init_migration_set } from "./migration-set.j
|
|
|
15
15
|
import { group, sum, unique } from "radashi";
|
|
16
16
|
import assert from "assert";
|
|
17
17
|
import path from "path";
|
|
18
|
-
import { mkdir, readdir, unlink, writeFile } from "fs/promises";
|
|
19
18
|
import chalk from "chalk";
|
|
19
|
+
import { mkdir, readdir, unlink, writeFile } from "fs/promises";
|
|
20
20
|
//#region src/migration/migrator.ts
|
|
21
21
|
/**
|
|
22
22
|
* 주어진 Promise가 ms 안에 완료되지 않으면 onTimeout 에러로 reject한다.
|
|
@@ -3,9 +3,9 @@ import { SD, init_sd } from "../dict/sd.js";
|
|
|
3
3
|
import { Sonamu, init_sonamu } from "../api/sonamu.js";
|
|
4
4
|
import assert from "assert";
|
|
5
5
|
import path from "path";
|
|
6
|
-
import crypto from "crypto";
|
|
7
6
|
import fs from "fs/promises";
|
|
8
7
|
import os from "os";
|
|
8
|
+
import crypto from "crypto";
|
|
9
9
|
//#region src/migration/slack-confirm.ts
|
|
10
10
|
var SlackConfirm;
|
|
11
11
|
var init_slack_confirm = __esmMin((() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { findApiRootPath, init_utils } from "../utils/utils.js";
|
|
2
2
|
import { join } from "path";
|
|
3
|
-
import { createHash } from "crypto";
|
|
4
3
|
import { homedir } from "os";
|
|
4
|
+
import { createHash } from "crypto";
|
|
5
5
|
import { connect } from "net";
|
|
6
6
|
//#region src/naite/naite-reporter.ts
|
|
7
7
|
/**
|
package/dist/syncer/checksum.js
CHANGED
|
@@ -7,8 +7,8 @@ import { GLOB_EXCLUDE, getChecksumPatternGroupInAbsolutePath, init_file_patterns
|
|
|
7
7
|
import { isEqual } from "radashi";
|
|
8
8
|
import { createReadStream } from "fs";
|
|
9
9
|
import path from "path";
|
|
10
|
-
import crypto from "crypto";
|
|
11
10
|
import { readFile, writeFile } from "fs/promises";
|
|
11
|
+
import crypto from "crypto";
|
|
12
12
|
import equal from "fast-deep-equal";
|
|
13
13
|
//#region src/syncer/checksum.ts
|
|
14
14
|
/**
|
|
@@ -14,8 +14,8 @@ import { init_lodash_able, wrapIf } from "../utils/lodash-able.js";
|
|
|
14
14
|
import { init_file_tracking, trackWritten } from "./file-tracking.js";
|
|
15
15
|
import { unique } from "radashi";
|
|
16
16
|
import path from "path";
|
|
17
|
-
import { mkdir, writeFile } from "fs/promises";
|
|
18
17
|
import chalk from "chalk";
|
|
18
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
19
19
|
//#region src/syncer/code-generator.ts
|
|
20
20
|
/**
|
|
21
21
|
* 템플릿을 렌더링하고 파일로 생성합니다.
|
|
@@ -6,8 +6,8 @@ import { exists, init_fs_utils } from "../utils/fs-utils.js";
|
|
|
6
6
|
import { Sonamu, init_sonamu } from "../api/sonamu.js";
|
|
7
7
|
import { EntityManager, init_entity_manager } from "../entity/entity-manager.js";
|
|
8
8
|
import { generateTemplate, init_code_generator } from "./code-generator.js";
|
|
9
|
-
import { rm } from "fs/promises";
|
|
10
9
|
import chalk from "chalk";
|
|
10
|
+
import { rm } from "fs/promises";
|
|
11
11
|
//#region src/syncer/entity-operations.ts
|
|
12
12
|
/**
|
|
13
13
|
* 새로운 엔티티를 생성합니다.
|
|
@@ -9,8 +9,8 @@ import { init_file_tracking, trackWritten } from "./file-tracking.js";
|
|
|
9
9
|
import { generateTemplate, init_code_generator } from "./code-generator.js";
|
|
10
10
|
import assert from "assert";
|
|
11
11
|
import path, { dirname } from "path";
|
|
12
|
-
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
13
12
|
import chalk from "chalk";
|
|
13
|
+
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
14
14
|
//#region src/syncer/syncer-actions.ts
|
|
15
15
|
async function actionSyncConfig() {
|
|
16
16
|
const { host, port } = Sonamu.config.server.listen ?? {};
|
package/dist/syncer/syncer.js
CHANGED
|
@@ -19,8 +19,8 @@ import { actionCopySharedToTargetsIfNotExists, actionGenerateHttps, actionGenera
|
|
|
19
19
|
import { group, unique } from "radashi";
|
|
20
20
|
import assert from "assert";
|
|
21
21
|
import path from "path";
|
|
22
|
-
import { unlink } from "fs/promises";
|
|
23
22
|
import chalk from "chalk";
|
|
23
|
+
import { unlink } from "fs/promises";
|
|
24
24
|
import { minimatch } from "minimatch";
|
|
25
25
|
import { EventEmitter } from "events";
|
|
26
26
|
import { hot } from "@sonamu-kit/hmr-hook";
|
package/dist/utils/formatter.js
CHANGED
|
@@ -3,8 +3,8 @@ import { init_controller, isTest } from "./controller.js";
|
|
|
3
3
|
import { cached, init_async_utils } from "./async-utils.js";
|
|
4
4
|
import { execute, init_process_utils } from "./process-utils.js";
|
|
5
5
|
import path, { dirname, join } from "path";
|
|
6
|
-
import { createHash } from "crypto";
|
|
7
6
|
import { readFile, unlink, writeFile } from "fs/promises";
|
|
7
|
+
import { createHash } from "crypto";
|
|
8
8
|
import { createRequire } from "module";
|
|
9
9
|
import { format } from "oxfmt";
|
|
10
10
|
//#region src/utils/formatter.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonamu",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.7",
|
|
4
4
|
"description": "Sonamu — TypeScript Fullstack API Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -129,10 +129,10 @@
|
|
|
129
129
|
"tsicli": "^1.0.5",
|
|
130
130
|
"vite": "8.0.16",
|
|
131
131
|
"vitest": "^4.1.9",
|
|
132
|
-
"@sonamu-kit/tasks": "^0.3.1",
|
|
133
|
-
"@sonamu-kit/hmr-runner": "^0.2.0",
|
|
134
132
|
"@sonamu-kit/hmr-hook": "^0.5.1",
|
|
135
|
-
"@sonamu-kit/ts-loader": "^2.2.0"
|
|
133
|
+
"@sonamu-kit/ts-loader": "^2.2.0",
|
|
134
|
+
"@sonamu-kit/hmr-runner": "^0.2.0",
|
|
135
|
+
"@sonamu-kit/tasks": "^0.3.1"
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
138
|
"@types/bcrypt": "^6",
|
package/src/api/base-frame.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { type Logger } from "@logtape/logtape";
|
|
|
3
3
|
import { type Knex } from "knex";
|
|
4
4
|
|
|
5
5
|
import { type DBPreset } from "../database/db";
|
|
6
|
-
// Static imports kept for non-async functions (getDB, getUpsertBuilder)
|
|
6
|
+
// Static imports kept for non-async functions (getDB, getPuri, getUpsertBuilder)
|
|
7
7
|
import { DB } from "../database/db";
|
|
8
|
+
import { PuriWrapper } from "../database/puri-wrapper";
|
|
8
9
|
import { UpsertBuilder } from "../database/upsert-builder";
|
|
9
10
|
import { convertDomainToCategory } from "../logger/category";
|
|
10
11
|
|
|
@@ -19,6 +20,18 @@ export abstract class BaseFrameClass {
|
|
|
19
20
|
return DB.getDB(which);
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
getPuri(which: DBPreset): PuriWrapper {
|
|
24
|
+
// 트랜잭션 컨텍스트에서 트랜잭션 획득
|
|
25
|
+
const trx = DB.getTransactionContext().getTransaction(which);
|
|
26
|
+
if (trx) {
|
|
27
|
+
return trx;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 트랜잭션이 없으면 새로운 PuriWrapper 반환
|
|
31
|
+
const db = this.getDB(which);
|
|
32
|
+
return new PuriWrapper(db, new UpsertBuilder());
|
|
33
|
+
}
|
|
34
|
+
|
|
22
35
|
getUpsertBuilder() {
|
|
23
36
|
return new UpsertBuilder();
|
|
24
37
|
}
|