reltype 0.1.8 → 0.1.9
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/CHANGELOG.md +14 -0
- package/dist/features/query/index.d.ts +1 -0
- package/dist/features/query/index.d.ts.map +1 -1
- package/dist/features/query/index.js +1 -0
- package/dist/features/query/joinRefs.d.ts +55 -0
- package/dist/features/query/joinRefs.d.ts.map +1 -0
- package/dist/features/query/joinRefs.js +78 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,20 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [0.1.8] — 2026-03-19
|
|
10
|
+
|
|
11
|
+
### Added — JOIN / SELECT 용 `TableDef` 헬퍼
|
|
12
|
+
|
|
13
|
+
- **`src/features/query/joinRefs.ts`** — 조인·SELECT 컬럼 나열을 짧게 쓰기 위한 유틸리티
|
|
14
|
+
- `sqlTableRef(def)` — `schema.table` 문자열 (`JOIN` 의 `table` 인자 등)
|
|
15
|
+
- `joinOnEq(leftDef, leftCol, rightDef, rightCol)` — `ON` 절 (`qualifiedName` + `quoteIdentifier` 기반)
|
|
16
|
+
- `sqlCols(def, '*')` / `sqlCols(def, ['firstName', ...])` — `테이블.*` 또는 camelCase 키 → `테이블.snake_col`
|
|
17
|
+
- `sqlColsAs(def, [['id', 'profile_id'], ...])` — `col AS alias_snake`
|
|
18
|
+
- `orderCol(def, colKey)` — `ORDER BY` 용 한정 컬럼 (`schema.table.column`)
|
|
19
|
+
- `src/features/query/index.ts`, **`src/index.ts`** — 위 심볼 공개 export
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
9
23
|
## [0.1.7] — 2026-03-19
|
|
10
24
|
|
|
11
25
|
### Added — Repository Query Debug
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/query/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/query/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { TableDef, Cols } from '../schema/interfaces/Table';
|
|
2
|
+
/**
|
|
3
|
+
* `JOIN` 의 `table` 인자나 `schema.table.column` 접두로 쓰는 **따옴표 없는** 참조 문자열.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* defineTable('account.users', cols) → `account.users`
|
|
8
|
+
* defineTable('users', cols, { schema: 'public' }) → `public.users`
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function sqlTableRef(def: TableDef<string, Cols>): string;
|
|
12
|
+
/**
|
|
13
|
+
* SELECT 목록용 조각: `schema.table.*` 또는 `schema.table.col_snake` 배열.
|
|
14
|
+
* 컬럼 키는 **테이블 정의의 camelCase 프로퍼티명**을 넘기면 snake_case 로 변환됩니다.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* .columns([
|
|
19
|
+
* ...sqlCols(usersTable, '*'),
|
|
20
|
+
* ...sqlCols(profileTable, ['image', 'userName']),
|
|
21
|
+
* ])
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function sqlCols<T extends TableDef<string, Cols>>(def: T, cols: '*' | ReadonlyArray<keyof T['cols'] & string>): string[];
|
|
25
|
+
/**
|
|
26
|
+
* SELECT 목록용: `schema.table.col AS alias_snake` (별칭은 DB snake_case 권장 → mapRows 가 camelCase 로 변환).
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* sqlColsAs(profileTable, [
|
|
31
|
+
* ['id', 'profile_id'],
|
|
32
|
+
* ['createdAt', 'profile_created_at'],
|
|
33
|
+
* ])
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function sqlColsAs<T extends TableDef<string, Cols>>(def: T, pairs: ReadonlyArray<readonly [keyof T['cols'] & string, string]>): string[];
|
|
37
|
+
/**
|
|
38
|
+
* `JOIN ... ON` 절 한 쌍 (등호). `TableDef.qualifiedName` 과 컬럼 `quoteIdentifier` 를 사용합니다.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* .join({
|
|
43
|
+
* type: 'LEFT',
|
|
44
|
+
* table: sqlTableRef(profileTable),
|
|
45
|
+
* on: joinOnEq(usersTable, 'id', profileTable, 'userId'),
|
|
46
|
+
* })
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function joinOnEq(left: TableDef<string, Cols>, leftCol: string, right: TableDef<string, Cols>, rightCol: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* `ORDER BY` 등에 넣을 **한정 컬럼** 문자열 (`schema.table.column`).
|
|
52
|
+
* `orderBy([{ column: orderCol(usersTable, 'id'), direction: 'DESC' }])`
|
|
53
|
+
*/
|
|
54
|
+
export declare function orderCol<T extends TableDef<string, Cols>>(def: T, col: keyof T['cols'] & string): string;
|
|
55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@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sqlTableRef = sqlTableRef;
|
|
4
|
+
exports.sqlCols = sqlCols;
|
|
5
|
+
exports.sqlColsAs = sqlColsAs;
|
|
6
|
+
exports.joinOnEq = joinOnEq;
|
|
7
|
+
exports.orderCol = orderCol;
|
|
8
|
+
const case_1 = require("../transform/case");
|
|
9
|
+
const sqlGuard_1 = require("../../utils/sqlGuard");
|
|
10
|
+
/**
|
|
11
|
+
* `JOIN` 의 `table` 인자나 `schema.table.column` 접두로 쓰는 **따옴표 없는** 참조 문자열.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* defineTable('account.users', cols) → `account.users`
|
|
16
|
+
* defineTable('users', cols, { schema: 'public' }) → `public.users`
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function sqlTableRef(def) {
|
|
20
|
+
return def.schema ? `${def.schema}.${def.name}` : def.name;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* SELECT 목록용 조각: `schema.table.*` 또는 `schema.table.col_snake` 배열.
|
|
24
|
+
* 컬럼 키는 **테이블 정의의 camelCase 프로퍼티명**을 넘기면 snake_case 로 변환됩니다.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* .columns([
|
|
29
|
+
* ...sqlCols(usersTable, '*'),
|
|
30
|
+
* ...sqlCols(profileTable, ['image', 'userName']),
|
|
31
|
+
* ])
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
function sqlCols(def, cols) {
|
|
35
|
+
const t = sqlTableRef(def);
|
|
36
|
+
if (cols === '*')
|
|
37
|
+
return [`${t}.*`];
|
|
38
|
+
return cols.map((c) => `${t}.${(0, case_1.toSnake)(String(c))}`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* SELECT 목록용: `schema.table.col AS alias_snake` (별칭은 DB snake_case 권장 → mapRows 가 camelCase 로 변환).
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* sqlColsAs(profileTable, [
|
|
46
|
+
* ['id', 'profile_id'],
|
|
47
|
+
* ['createdAt', 'profile_created_at'],
|
|
48
|
+
* ])
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
function sqlColsAs(def, pairs) {
|
|
52
|
+
const t = sqlTableRef(def);
|
|
53
|
+
return pairs.map(([col, aliasSnake]) => `${t}.${(0, case_1.toSnake)(String(col))} as ${aliasSnake}`);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* `JOIN ... ON` 절 한 쌍 (등호). `TableDef.qualifiedName` 과 컬럼 `quoteIdentifier` 를 사용합니다.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* .join({
|
|
61
|
+
* type: 'LEFT',
|
|
62
|
+
* table: sqlTableRef(profileTable),
|
|
63
|
+
* on: joinOnEq(usersTable, 'id', profileTable, 'userId'),
|
|
64
|
+
* })
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
function joinOnEq(left, leftCol, right, rightCol) {
|
|
68
|
+
const lc = (0, sqlGuard_1.quoteIdentifier)((0, case_1.toSnake)(leftCol));
|
|
69
|
+
const rc = (0, sqlGuard_1.quoteIdentifier)((0, case_1.toSnake)(rightCol));
|
|
70
|
+
return `${left.qualifiedName}.${lc} = ${right.qualifiedName}.${rc}`;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* `ORDER BY` 등에 넣을 **한정 컬럼** 문자열 (`schema.table.column`).
|
|
74
|
+
* `orderBy([{ column: orderCol(usersTable, 'id'), direction: 'DESC' }])`
|
|
75
|
+
*/
|
|
76
|
+
function orderCol(def, col) {
|
|
77
|
+
return `${sqlTableRef(def)}.${(0, case_1.toSnake)(String(col))}`;
|
|
78
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { getPool, withClient, closePool, getPoolStatus, checkPoolHealth } from '
|
|
|
13
13
|
export type { PoolStatus } from './features/connection/pool';
|
|
14
14
|
export { runInTx } from './features/connection/tx';
|
|
15
15
|
export { buildSelect } from './features/query/select';
|
|
16
|
+
export { sqlTableRef, sqlCols, sqlColsAs, joinOnEq, orderCol, } from './features/query/joinRefs';
|
|
16
17
|
export { buildInsert } from './features/query/insert';
|
|
17
18
|
export { buildUpdate } from './features/query/update';
|
|
18
19
|
export { buildDelete } from './features/query/delete';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAe,0BAA0B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAY,yBAAyB,CAAC;AAC5D,YAAY,EAAE,SAAS,EAAE,MAAS,yBAAyB,CAAC;AAC5D,YAAY,EAAE,QAAQ,EAAE,MAAU,qCAAqC,CAAC;AACxE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AACzE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAG7F,OAAO,EAAE,UAAU,EAAE,MAAa,8BAA8B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAe,4BAA4B,CAAC;AAC/D,YAAY,EAAE,QAAQ,EAAE,MAAU,4BAA4B,CAAC;AAC/D,YAAY,EAAE,KAAK,EAAE,MAAa,uCAAuC,CAAC;AAC1E,YAAY,EAAE,QAAQ,EAAE,MAAU,uCAAuC,CAAC;AAG1E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC5G,YAAY,EAAE,UAAU,EAAE,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,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,EAAE,MAAM,EAAE,MAAiB,gBAAgB,CAAC;AACnD,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGxE,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateJoinType = exports.validateAggregateFn = exports.validateOrderDir = exports.escapeSchemaIdentifier = exports.quoteIdentifier = exports.Logger = exports.readEnv = exports.NodeEnvSource = exports.PostgresConfig = exports.getDatabaseConfig = exports.DbError = exports.mapRows = exports.mapRow = exports.keysToSnake = exports.keysToCamel = exports.toSnake = exports.toCamel = exports.QueryBuilder = exports.buildWhere = exports.buildBulkInsert = exports.buildUpsert = exports.buildDelete = exports.buildUpdate = exports.buildInsert = exports.buildSelect = exports.runInTx = exports.checkPoolHealth = exports.getPoolStatus = exports.closePool = exports.withClient = exports.getPool = exports.BaseRepo = exports.createRepo = exports.defineTable = exports.Col = exports.col = void 0;
|
|
3
|
+
exports.validateJoinType = exports.validateAggregateFn = exports.validateOrderDir = exports.escapeSchemaIdentifier = exports.quoteIdentifier = exports.Logger = exports.readEnv = exports.NodeEnvSource = exports.PostgresConfig = exports.getDatabaseConfig = exports.DbError = exports.mapRows = exports.mapRow = exports.keysToSnake = exports.keysToCamel = exports.toSnake = exports.toCamel = exports.QueryBuilder = exports.buildWhere = exports.buildBulkInsert = exports.buildUpsert = exports.buildDelete = exports.buildUpdate = exports.buildInsert = exports.orderCol = exports.joinOnEq = exports.sqlColsAs = exports.sqlCols = exports.sqlTableRef = exports.buildSelect = exports.runInTx = exports.checkPoolHealth = exports.getPoolStatus = exports.closePool = exports.withClient = exports.getPool = exports.BaseRepo = exports.createRepo = exports.defineTable = exports.Col = exports.col = void 0;
|
|
4
4
|
// ── Schema ──────────────────────────────────────────────────────────────────
|
|
5
5
|
var column_1 = require("./features/schema/column");
|
|
6
6
|
Object.defineProperty(exports, "col", { enumerable: true, get: function () { return column_1.col; } });
|
|
@@ -24,6 +24,12 @@ Object.defineProperty(exports, "runInTx", { enumerable: true, get: function () {
|
|
|
24
24
|
// ── Query builders ───────────────────────────────────────────────────────────
|
|
25
25
|
var select_1 = require("./features/query/select");
|
|
26
26
|
Object.defineProperty(exports, "buildSelect", { enumerable: true, get: function () { return select_1.buildSelect; } });
|
|
27
|
+
var joinRefs_1 = require("./features/query/joinRefs");
|
|
28
|
+
Object.defineProperty(exports, "sqlTableRef", { enumerable: true, get: function () { return joinRefs_1.sqlTableRef; } });
|
|
29
|
+
Object.defineProperty(exports, "sqlCols", { enumerable: true, get: function () { return joinRefs_1.sqlCols; } });
|
|
30
|
+
Object.defineProperty(exports, "sqlColsAs", { enumerable: true, get: function () { return joinRefs_1.sqlColsAs; } });
|
|
31
|
+
Object.defineProperty(exports, "joinOnEq", { enumerable: true, get: function () { return joinRefs_1.joinOnEq; } });
|
|
32
|
+
Object.defineProperty(exports, "orderCol", { enumerable: true, get: function () { return joinRefs_1.orderCol; } });
|
|
27
33
|
var insert_1 = require("./features/query/insert");
|
|
28
34
|
Object.defineProperty(exports, "buildInsert", { enumerable: true, get: function () { return insert_1.buildInsert; } });
|
|
29
35
|
var update_1 = require("./features/query/update");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reltype",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Type-first relational modeling for PostgreSQL in TypeScript. Fluent query builder with automatic camelCase ↔ snake_case conversion, CRUD, streaming, cursor pagination, and hooks.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|