Skip to content

Commit 68409e8

Browse files
committed
Modification document for Multi databases support feature
1 parent 20378ed commit 68409e8

5 files changed

Lines changed: 69 additions & 8 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ A Node.js-based tool for generating Excel files from SQL query results.
5050
- 🔧 **Input Validation**: Automatic whitespace trimming for file path inputs
5151
- 🗂️ **Filename Variables**: Use `${DATE:...}`, `${DATE.TZ:...}`, and `${DB_NAME}` in `excel.output` (also supports custom `$(DB_NAME}`)
5252

53+
## 🔗 Multi-Database Usage
54+
55+
- **Supported drivers**: MSSQL (`mssql`), MySQL (`mysql2`), MariaDB (`mysql2`), PostgreSQL (`pg`), SQLite (`better-sqlite3`), Oracle (`oracledb`)
56+
- **Configuration**: `config/dbinfo.json` with per-DB keys and `type` (optional for MSSQL default)
57+
- **Runtime DB selection precedence**
58+
- Default DB key: `--db` (CLI) > `excel.db` (XML/JSON)
59+
- Sheet: `sheet.db` > Default DB
60+
- Dynamic variables: `dynamicVar.database` or `dynamicVar.db` > Default DB
61+
- **Connection test**
62+
- Dev: `npm run list-dbs`
63+
- EXE: `sql2excel.exe list-dbs`
64+
5365
## v2.1.2-beta(v1.3.2) Highlights
5466

5567
- Per-sheet export directory naming simplified

README_KR.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ SQL 쿼리 결과를 엑셀 파일로 생성하는 Node.js 기반 도구입니
5050
- 🔧 **입력 유효성 검증**: 파일 경로 입력에 대한 자동 공백 제거
5151
- 🗂️ **파일명 변수**: `excel.output`에서 `${DATE:...}`, `${DATE.TZ:...}`, `${DB_NAME}` 사용 가능 (커스텀 `$(DB_NAME}`도 지원)
5252

53+
## 🔗 다중 데이터베이스 사용
54+
55+
- **지원 드라이버**: MSSQL(`mssql`), MySQL(`mysql2`), MariaDB(`mysql2`), PostgreSQL(`pg`), SQLite(`better-sqlite3`), Oracle(`oracledb`)
56+
- **설정 파일**: `config/dbinfo.json`에 DB 키별 접속 정보와 `type` 지정 (MSSQL은 생략 시 기본값)
57+
- **런타임 DB 선택 우선순위**
58+
- 기본 DB 키: `--db`(CLI) > `excel.db`(XML/JSON)
59+
- 시트: `sheet.db` > 기본 DB
60+
- 동적 변수: `dynamicVar.database` 또는 `dynamicVar.db` > 기본 DB
61+
- **연결 테스트**
62+
- 개발: `npm run list-dbs`
63+
- EXE: `sql2excel.exe list-dbs`
64+
5365
## v2.1.2-beta(v1.3.2) 하이라이트
5466

5567
- 시트별 내보내기 디렉토리 명명 단순화

USER_MANUAL.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ npm run build
122122
### 3. Database Connection Setup
123123
Create `config/dbinfo.json` file:
124124

125-
#### Multi-Database Support (v1.3.0+)
125+
#### Multi-Database Support (v2.0.0+)
126126
```json
127127
{
128128
"sampleDB": {
@@ -454,6 +454,20 @@ sql2excel.exe --mode=help
454454
}
455455
```
456456

457+
## 🔗 Multi-Database
458+
459+
This tool supports multiple databases with unified adapters and flexible routing.
460+
461+
- **Supported drivers**: MSSQL (`mssql`), MySQL (`mysql2`), MariaDB (`mysql2`), PostgreSQL (`pg`), SQLite (`better-sqlite3`), Oracle (`oracledb`)
462+
- **Configuration**: Define multiple DB keys in `config/dbinfo.json` with optional `type` (defaults to `mssql`) and connection fields. See examples above and in “Multi-Database Support (v2.0.0+)”.
463+
- **Runtime DB selection precedence (v2.1.5+)**
464+
- Default DB key: CLI `--db` > `excel.db`
465+
- Per sheet: `sheet.db` overrides default DB
466+
- Dynamic variables: `dynamicVar.database` or `dynamicVar.db` overrides default DB
467+
- **Mixed-DB usage**: You can query different DBs within a single export. See “Multi-Database Support (v2.0.0+)” for XML/JSON examples.
468+
- **Connection test**: Validate connectivity before export with `node src/excel-cli.js list-dbs` (dev) or `sql2excel.exe list-dbs` (EXE).
469+
- **Adapter behavior**: Row limiting and functions are adapted per DB (e.g., MSSQL uses TOP, MySQL/MariaDB use LIMIT).
470+
457471
## 🎨 Template Style System
458472

459473
SQL2Excel includes a comprehensive template style system with pre-defined Excel styling templates.
@@ -824,7 +838,7 @@ This feature works automatically - no configuration required!
824838

825839
## 🎨 Advanced Features
826840

827-
### 1. Multi-Database Support (v1.3.0+)
841+
### 1. Multi-Database Support (v2.0.0+)
828842

829843
SQL2Excel now supports multiple database types with a unified interface:
830844

@@ -947,6 +961,13 @@ node src/excel-cli.js list-dbs
947961
sql2excel-v1.3.0.exe list-dbs
948962
```
949963

964+
#### Runtime DB selection precedence (v2.1.5+)
965+
966+
- Default DB key: CLI `--db` > `excel.db`
967+
- Per sheet: `sheet.db` overrides default DB
968+
- Dynamic variables: `dynamicVar.database` or `dynamicVar.db` overrides default DB
969+
- Tip: Use `list-dbs` (above) to verify connections before export
970+
950971
### 2. Excel Styling
951972

952973
#### Font Styling

USER_MANUAL_KR.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ npm run build
121121
### 3. 데이터베이스 연결 설정
122122
`config/dbinfo.json` 파일을 생성하세요:
123123

124-
#### 다중 데이터베이스 지원 (v1.3.0+)
124+
#### 다중 데이터베이스 지원 (v2.0.0+)
125125
```json
126126
{
127127
"sampleDB": {
@@ -466,12 +466,21 @@ sql2excel.exe --mode=help
466466
- 내부 줄바꿈(\r/\n)은 CSV/TXT 모두 공백으로 정규화
467467
- 날짜 직렬화: `yyyy-MM-dd HH:mm:ss` (24시간)
468468

469-
## 🎨 템플릿 스타일 시스템
469+
## 🔗 다중 데이터베이스
470470

471-
SQL2Excel은 사전 정의된 엑셀 스타일링 템플릿을 포함한 포괄적인 템플릿 스타일 시스템을 제공합니다.
471+
통합 어댑터와 유연한 라우팅으로 여러 데이터베이스를 지원합니다.
472472

473-
### 사용 가능한 템플릿 스타일
473+
- **지원 드라이버**: MSSQL(`mssql`), MySQL(`mysql2`), MariaDB(`mysql2`), PostgreSQL(`pg`), SQLite(`better-sqlite3`), Oracle(`oracledb`)
474+
- **설정**: `config/dbinfo.json`에 다수의 DB 키를 정의하고 `type`(미지정 시 `mssql`)과 접속 정보를 설정하세요. 상세 예시는 위 “다중 데이터베이스 지원 (v2.0.0+)” 섹션 참고.
475+
- **런타임 DB 선택 우선순위 (v2.1.5+)
476+
- 기본 DB 키: CLI `--db` > `excel.db`
477+
- 시트별: `sheet.db`가 기본 DB를 오버라이드
478+
- 동적 변수: `dynamicVar.database` 또는 `dynamicVar.db`가 기본 DB를 오버라이드
479+
- **혼합 사용**: 하나의 내보내기에서 서로 다른 DB를 동시에 사용할 수 있습니다. XML/JSON 예시는 “다중 데이터베이스 지원 (v2.0.0+)” 섹션을 참고하세요.
480+
- **연결 테스트**: 내보내기 전 `node src/excel-cli.js list-dbs`(개발) 또는 `sql2excel.exe list-dbs`(EXE)로 확인하세요.
481+
- **어댑터 동작**: 행 제한과 함수가 DB별로 자동 조정됩니다 (예: MSSQL=TOP, MySQL/MariaDB=LIMIT).
474482

483+
## 🎨 템플릿 스타일 시스템
475484
| 스타일 ID | 이름 | 설명 |
476485
|----------|------|------|
477486
| `default` | 기본 스타일 | 기본 엑셀 스타일 |
@@ -836,7 +845,7 @@ SQL2Excel은 생성된 각 엑셀 시트에 자동으로 생성 타임스탬프
836845

837846
## 🎨 고급 기능
838847

839-
### 1. 다중 데이터베이스 지원 (v1.3.0+)
848+
### 1. 다중 데이터베이스 지원 (v2.0.0+)
840849

841850
SQL2Excel은 이제 통합 인터페이스로 여러 데이터베이스 타입을 지원합니다:
842851

@@ -959,6 +968,13 @@ node src/excel-cli.js list-dbs
959968
sql2excel-v1.3.0.exe list-dbs
960969
```
961970

971+
#### 런타임 DB 선택 우선순위 (v2.1.5+)
972+
973+
- 기본 DB 키: CLI `--db` > `excel.db`
974+
- 시트별: `sheet.db`가 기본 DB를 오버라이드
975+
- 동적 변수: `dynamicVar.database` 또는 `dynamicVar.db`가 기본 DB를 오버라이드
976+
- 팁: 내보내기 전에 위 `list-dbs`로 연결 상태를 점검하세요
977+
962978
### 2. 엑셀 스타일링
963979

964980
#### 글꼴 스타일링

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sql2excel",
3-
"version": "2.1.5-beta",
3+
"version": "2.1.5",
44
"description": "SQL 쿼리 결과를 엑셀 파일로 저장하는 도구 (시트별 쿼리, 변수, XML/JSON 지원)",
55
"main": "app.js",
66
"scripts": {

0 commit comments

Comments
 (0)