reltype 0.1.5 → 0.1.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +37 -3
  2. package/README.ko.md +517 -623
  3. package/README.md +511 -623
  4. package/dist/features/query/builder.d.ts +13 -3
  5. package/dist/features/query/builder.d.ts.map +1 -1
  6. package/dist/features/query/builder.js +39 -13
  7. package/dist/features/query/bulkInsert.d.ts +1 -0
  8. package/dist/features/query/bulkInsert.d.ts.map +1 -1
  9. package/dist/features/query/bulkInsert.js +3 -1
  10. package/dist/features/query/insert.d.ts +1 -0
  11. package/dist/features/query/insert.d.ts.map +1 -1
  12. package/dist/features/query/insert.js +3 -1
  13. package/dist/features/query/select.d.ts +1 -1
  14. package/dist/features/query/select.d.ts.map +1 -1
  15. package/dist/features/query/select.js +7 -2
  16. package/dist/features/query/update.d.ts +1 -0
  17. package/dist/features/query/update.d.ts.map +1 -1
  18. package/dist/features/query/update.js +3 -1
  19. package/dist/features/query/upsert.d.ts +1 -0
  20. package/dist/features/query/upsert.d.ts.map +1 -1
  21. package/dist/features/query/upsert.js +12 -6
  22. package/dist/features/query/where.d.ts +1 -0
  23. package/dist/features/query/where.d.ts.map +1 -1
  24. package/dist/features/query/where.js +3 -1
  25. package/dist/features/schema/table.d.ts.map +1 -1
  26. package/dist/features/schema/table.js +4 -2
  27. package/dist/index.d.ts +1 -0
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +8 -1
  30. package/dist/utils/index.d.ts +1 -0
  31. package/dist/utils/index.d.ts.map +1 -1
  32. package/dist/utils/index.js +1 -0
  33. package/dist/utils/sqlGuard.d.ts +42 -0
  34. package/dist/utils/sqlGuard.d.ts.map +1 -0
  35. package/dist/utils/sqlGuard.js +94 -0
  36. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,12 +6,46 @@ This project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
7
  ---
8
8
 
9
+ ## [0.1.6] — 2026-03-19
10
+
11
+ ### Security — SQL Injection 전면 차단
12
+
13
+ 이번 릴리즈에서는 SQL Injection 취약점을 방어하기 위한 `sqlGuard` 유틸리티를 도입하고,
14
+ 모든 SQL 식별자(컬럼명, 테이블명, 집계 함수 등)에 대한 검증·이스케이프를 적용했습니다.
15
+
16
+ #### 신규 파일
17
+
18
+ - **`src/utils/sqlGuard.ts`** — SQL 보안 유틸리티 신규 추가
19
+ - `quoteIdentifier(raw)` — 식별자 패턴 검증 후 PostgreSQL 표준 이중 따옴표 이스케이프 (`"` → `""`)
20
+ - `escapeSchemaIdentifier(name)` — 스키마·테이블 정의 시 `"` 이스케이프 (패턴 검증 없음, 개발자 제어 값)
21
+ - `validateOrderDir(dir)` — ORDER BY 방향 화이트리스트 (ASC/DESC)
22
+ - `validateAggregateFn(fn)` — 집계 함수 화이트리스트 (COUNT/SUM/AVG/MIN/MAX)
23
+ - `validateJoinType(type)` — JOIN 타입 화이트리스트 (INNER/LEFT/RIGHT/FULL)
24
+ - 유효하지 않은 값 감지 시 `logger.error` 로 기록 후 안전한 기본값 반환 (no-throw 정책 준수)
25
+
26
+ #### 수정 파일
27
+
28
+ | 파일 | 수정 내용 |
29
+ |---|---|
30
+ | `src/features/schema/table.ts` | `escapeSchemaIdentifier` 적용 — 식별자 내 `"` 이중 이스케이프 |
31
+ | `src/features/query/where.ts` | 컬럼명에 `quoteIdentifier` 적용 |
32
+ | `src/features/query/insert.ts` | INSERT 컬럼명에 `quoteIdentifier` 적용 |
33
+ | `src/features/query/update.ts` | SET 절 컬럼명에 `quoteIdentifier` 적용 |
34
+ | `src/features/query/upsert.ts` | INSERT 컬럼명·`conflictCol`에 `quoteIdentifier` 적용, `EXCLUDED."col"` 이스케이프 |
35
+ | `src/features/query/bulkInsert.ts` | INSERT 컬럼명에 `quoteIdentifier` 적용 |
36
+ | `src/features/query/select.ts` | ORDER BY 컬럼 `quoteIdentifier`, 방향 `validateOrderDir` 적용 |
37
+ | `src/features/query/builder.ts` | `renderCond`·`buildJoinSQL`·`buildGroupBySQL`·`buildOrderBySQL`·`calculate` 전체에 가드 적용, `cursorColumn` 사전 검증 추가 |
38
+ | `src/index.ts` | `sqlGuard` 유틸리티 공개 export 추가 |
39
+ | `src/utils/index.ts` | `sqlGuard` re-export 추가 |
40
+
41
+ ---
42
+
9
43
  ## [0.1.5] — 2026-03-19
10
44
 
11
45
  ### Changed
12
- - `README.md` — 전체 문서 최신 API 기준으로 업데이트
13
- - `README.ko.md` — 한국어 문서 최신 API 기준으로 업데이트
14
- - `CHANGELOG.md` — 0.1.1 ~ 0.1.4 릴리즈 내역 소급 작성
46
+ - `README.md` — 프로젝트 소개 전면 개편, Prisma/TypeORM/Drizzle 비교표 추가, FAQ 및 사용 시나리오 보강, 대용량/에러처리/풀 설정 가이드 상세화
47
+ - `README.ko.md` — 한국어 문서 동일 수준으로 전면 개편 (비교표, FAQ, 운영 가이드 포함)
48
+ - `CHANGELOG.md` — 0.1.1 ~ 0.1.4 릴리즈 내역 소급 작성 및 설명 보강
15
49
 
16
50
  ---
17
51