A comprehensive utility tool for managing various local environment utilities in a unified application.
π Multi-language Support: English / Korean (νκ΅μ΄)
my-node-client-util-app/
βββ app.js # π Main integrated application
βββ src/
β βββ modules/ # π¦ Modularized features
β βββ ConfigManager.js # Configuration management
β βββ DBConnectionChecker.js # Universal DB connection and permission checker
β βββ DBExecutor.js # Universal DB SQL executor
β βββ CSVQueryExecutor.js # CSV-based batch query executor
β βββ TelnetChecker.js # Server Telnet connection checker
β βββ database/ # DB type-specific connection classes
β βββ DatabaseFactory.js # DB connection factory
β βββ MSSQLConnection.js # MSSQL connection class
β βββ MySQLConnection.js # MySQL connection class
β βββ PostgreSQLConnection.js # PostgreSQL connection class
β βββ OracleConnection.js # Oracle connection class
βββ config/
β βββ dbinfo.json # DB connection information settings
βββ request/ # Resource files directory (v1.2.0+)
β βββ DB_sample.csv # DB check CSV files (starts with DB_)
β βββ server_sample.csv # Telnet check CSV files (starts with server_)
β βββ SQL2CSV_sample.csv # CSV-based batch query file (starts with SQL2CSV_) (v1.3.8+)
β βββ sql_files/ # SQL files directory
β βββ SQL_001.sql # SQL query template
β βββ SQL_001.csv # SQL parameter template
βββ results/ # Check results (auto-generated)
β βββ db_connection_check_*.csv # DB check results
β βββ telnet_connection_check_*.csv # Telnet check results
β βββ sql2csv_result/ # CSV-based query results (v1.3.6+)
β βββ README.md # Results format documentation
βββ log/ # Execution logs (auto-generated)
βββ run.bat # π― Launcher (English)
βββ μ€ννκΈ°.bat # π― Launcher (Korean)
New Features:
- Added direct execution with
--modeflags (no menu interaction)- Modes:
db,telnet,sql,csv,config - Works in both Node and packaged EXE
- Modes:
Documentation:
- Updated user manuals with non-interactive CLI usage and examples
- Noted APP_ROOT-relative path behavior in packaged builds
CSV-based Batch Query Execution Updates:
- File naming convention updated:
SQL_βSQL2CSV_prefix inrequest/ - Result path variables: Added support for
${DB_NAME}(selected DB key) - Menu labels and file discovery updated to list
SQL2CSV_*.csvonly
Directory Rename:
- Directory name unified:
request_resourcesβrequest- Migration: Move existing files from
request_resources/torequest/
- Migration: Move existing files from
Message Refactoring:
- Parameterized, builder-based message generation for DB/Telnet/SQL/CSV
- Preserved existing message keys and full i18n support (en/kr)
Documentation Updates:
- Updated README and user manuals to reflect
SQL2CSV_prefix and${DB_NAME}usage
Bug Fixes:
- Enhanced Newline Handling: Procedure definitions and multi-line text now display cleanly in CSV format
- Replaces all newlines with spaces for single-line storage
- Quotes values only when they contain commas/quotes in CSV files
- Easy to read in Excel or text editors
New Module:
- CSVQueryExecutor: Execute multiple SQL queries from a CSV file in batch
- Define queries and output file paths in CSV format
- Supports date/time variables in file paths:
${DATE:format} - Automatic directory creation for output files
- Results saved as CSV files with timestamp
Security Features:
- Query Validation: Only SELECT queries and safe system procedures allowed
- Blocked: INSERT, UPDATE, DELETE, DROP, TRUNCATE, ALTER, CREATE
- Allowed: sp_helptext, sp_help, sp_who, sp_columns, sp_tables, etc.
- Protection: Prevents accidental data modification or deletion
CSV Format:
SQL,result_filepath
"select * from users;",results/sql2csv_result/users_${DATE:yyyyMMddHHmmss}.csv
"exec sp_helptext 'dbo.MyProc';",results/sql2csv_result/proc_definition.txt
Additional Module Localization:
- Added multi-language messages to DBConnectionChecker, DBExecutor, and TelnetChecker modules
- All user messages unified in English/Korean
- All error messages translated including database connection errors, SQL execution errors
- Improved translation quality of user input prompts
Documentation Updates:
- Updated request documentation
- Updated user manual
- Synchronized version information
Multi-language Support (English/Korean):
- Added
--langparameter to select UI language- English: Run with
run.batornode app.js --lang=en - Korean: Run with
μ€ννκΈ°.batornode app.js --lang=kr
- English: Run with
- All UI messages (menus, prompts, errors) available in both languages
- Over 60 messages translated for seamless experience
CSV Encoding:
- UTF-8 encoding required for all CSV files
- Fixed Korean character corruption issues
- Applies to all CSV inputs: DB connection check, Telnet check, SQL parameters
- π Important: Save your CSV files with UTF-8 encoding (see User Manual for details)
Release Script Enhancement:
- Version automatically read from
package.json - Dual launcher scripts (English/Korean) generated automatically
- ZIP archive creation for easy distribution
Fixed Release Package Path Resolution:
- Fixed path resolution in pkg executable: Changed from
process.cwd()topath.dirname(process.execPath) - Root cause:
process.cwd()returns the directory where the command was executed, not where the executable is located - Impact: Release package now correctly reads resources from the executable's directory regardless of where it's run from
- Affected:
request/,config/dbinfo.json,results/,log/directories
-
CSV Result File Generation: Automatically save SQL execution results to structured CSV
- Location:
results/sql_files/ - Filename:
{SQL_name}_{DB_name}_{timestamp}.csv - DB info header and condition-based grouping
- Location:
-
Preprocessor Directive: Specify database connection with
#DATABASEor#DBin SQL files#DATABASE sampleDB SELECT * FROM users WHERE id = @user_id;
-
JSON Parameter Support: Support JSON format parameter files alongside CSV
[ { "user_id": 1 }, { "user_id": 2 } ]
- MariaDB Database: Support MariaDB with MySQL-compatible driver
- Supported DBs: MSSQL, MySQL, MariaDB β, PostgreSQL, Oracle
- Database-specific separators: Clear visual separation between database checks
- Improved readability: Better formatting with line breaks and emojis
- Real-time progress: Enhanced console output during checks
- Operation-specific errors: SELECT/INSERT/DELETE error messages saved to CSV
- Comprehensive logging: Up to 500 characters of detailed error information
- Better troubleshooting: Specific error details for problem diagnosis
- Unified CSV location: All CSV files now in
request/directly - Smart filtering: Automatic file filtering based on naming convention
- DB checks: Files starting with
DB_ - Telnet checks: Files starting with
server_
- DB checks: Files starting with
- Simplified structure: No more subdirectories for CSV files
- Multi-column conditions: DELETE queries now use all specified columns
- Safer testing: More precise data deletion for accurate permission checks
- Better query logging: Actual executed queries saved to results
Double-click run.bat to launch the integrated menu:
========================================
Node.js Integrated Utility Tool
========================================
π Main Menu
1. Database Connection and Permission Check
2. Server Telnet Connection Check
3. Database SQL Execution
4. CSV-based Batch Query Execution β NEW
5. Configuration Management
0. Exit
Select function to execute:
# Run integrated application
npm start
# or
node app.js- Multi-DB Support: MSSQL, MySQL, PostgreSQL, Oracle support
- Unified Management: Manage all features in a single application
- CSV Result Export: All check results are automatically saved to CSV files
- Batch Processing: Execute all checks at once
- Modularization: Improved code structure for better maintainability
- User-Friendly: Intuitive menu system
The following databases are supported:
- Microsoft SQL Server (MSSQL)
- MySQL
- PostgreSQL
- Oracle Database
DBConnectionChecker.js performs comprehensive checks including:
-
Basic Connection Test
- Attempts database connection to specified server:port
- Measures connection success/failure and elapsed time
-
Database Permission Check (v1.1.0 Updated)
- SELECT Permission: Executes actual query specified in CSV
- INSERT Permission: Inserts test data into actual table specified in CSV
- DELETE Permission: Deletes inserted test data
β οΈ Note: CREATE, DROP, and UPDATE permission checks have been removed for safety. -
Actual Query Testing
- Executes SELECT query specified in CSV file
- Verifies query execution success and results
- Tests under the same conditions as production environment
-
Result Display
[192.168.1.100:1433][MSSQL][sa][SampleDB][customers] β [β Success] [Permissions: SELECT, INSERT, DELETE] [192.168.1.101:3306][MYSQL][root][TestDB][users] β [β Failed] [LOGIN_FAILED] Login failed -
CSV Result Export
- All check results are automatically saved to CSV files with timestamp
- Files are saved in
results/directory - Records success/failure status for each permission
- Includes detailed information for analysis and reporting
db_name,username,password,server_ip,port,db_type,db_title
SampleDB,sa,1111,localhost,1433,mssql,Sample MSSQL DB
TestDB,root,1111,localhost,3306,mysql,Test MySQL DB
UserDB,postgres,1111,localhost,5432,postgresql,User PostgreSQL DB
Required Columns: db_name, username, password, server_ip, port, db_type
Optional Columns: db_title
db_name,username,password,server_ip,port,db_type,db_title,select_sql,crud_test_table,crud_test_columns,crud_test_values
SampleDB,sa,1111,localhost,1433,mssql,Sample DB,"SELECT top 3 customername from customers",customers,"customercode, customername","test001, Test Customer"
TestDB,root,1111,localhost,3306,mysql,Test DB,"SELECT title from boards",boards,"title, content, userid","test, test content, admin"
UserDB,postgres,1111,localhost,5432,postgresql,User DB,"SELECT name from servers",users,"id, email, name","test001, test@example.com, Test User"
Additional Columns (For Permission Check):
select_sql: SELECT query to executecrud_test_table: Table name for INSERT/DELETE testingcrud_test_columns: Column names for testing (comma-separated)crud_test_values: Test values (comma-separated)
Database Types:
db_type: mssql, mysql, postgresql, oracle
server_ip,port,server_name
192.168.1.100,8080,HQ ERP Web Server
192.168.1.101,3306,HQ WMS DB Server
192.168.1.102,22,Branch CRM SSH Server
Required Columns: server_ip, port
Optional Columns: server_name (Server description for identification)
-
Node.js Installation
- Node.js 14.0.0 or higher required
- Download from https://nodejs.org/
-
Dependency Packages
- Automatically runs
npm installwhen batch file is executed - Required packages: csv-parser, mssql, mysql2, pg, oracledb, telnet-client
- Automatically runs
Database connection information is managed in the config/dbinfo.json file:
{
"sampleDB": {
"type": "mssql",
"user": "sample",
"password": "sample1234!",
"server": "localhost",
"database": "SampleDB",
"port": 1433,
"options": { "encrypt": true, "trustServerCertificate": true }
},
"mysqlDB": {
"type": "mysql",
"user": "root",
"password": "password",
"server": "localhost",
"database": "testdb",
"port": 3306,
"options": { "ssl": false }
},
"postgresDB": {
"type": "postgresql",
"user": "postgres",
"password": "password",
"server": "localhost",
"database": "testdb",
"port": 5432,
"options": { "ssl": false }
},
"oracleDB": {
"type": "oracle",
"user": "hr",
"password": "password",
"server": "localhost",
"database": "xe",
"port": 1521
}
}The application provides a Configuration Management menu for system information:
- System Information: Check system details and configuration file status
- Available Databases: View all configured databases from
config/dbinfo.json
Note: All database connections use config/dbinfo.json. No additional environment variables are required.
build.bat - Build executable only
build.batActions:
- Check Node.js and npm environment
- Install dependencies (npm install)
- Build executable using pkg
- Output:
dist\my-node-client-util-app.exe
When to use: Quick build testing
release.bat - Build + Deploy Package Automation β
release.batActions:
- Clean previous releases
- Build application (npm run build)
- Create release/my-node-client-util-app-v1.3.0/ folder
- Copy executable
- Copy configuration files (config/)
- Copy sample files (request/)
- Create output folders (results/, log/)
- Copy documentation (README, manuals, changelog - 8 files)
- Create launcher script (run.bat)
- Generate version info file (VERSION_INFO.txt)
- Generate release notes (RELEASE_NOTES.txt)
Output:
release/my-node-client-util-app-v1.3.0/- Deployment packagerelease/my-node-client-util-app-v1.3.0.zip- ZIP archive (optional)
When to use: Creating complete deployment package (recommended)
# 1. Modify code and test
node app.js
# 2. Quick build test
build.bat
# 3. Create official release package (recommended)
release.bat1. Download release/my-node-client-util-app-v1.3.0.zip
2. Extract the archive
3. Edit config/dbinfo.json for your environment
4. Run run.bat
my-node-client-util-app-v1.3.0/
βββ my-node-client-util-app.exe # Executable
βββ run.bat # Launcher script
βββ VERSION_INFO.txt # Version information
βββ RELEASE_NOTES.txt # Release notes
βββ config/
β βββ dbinfo.json # DB configuration (user customizable)
βββ request/
β βββ DB_sample.csv # DB check sample
β βββ server_sample.csv # Telnet check sample
β βββ sql_files/
β βββ SQL_001.sql # SQL sample (#DATABASE directive)
β βββ SQL_001.csv # Parameter sample
βββ results/
β βββ sql_files/ # SQL execution results location
βββ log/ # Log files location
βββ Documentation/
βββ README.md
βββ README_KR.md
βββ USER_MANUAL.md
βββ USER_MANUAL_KR.md
βββ CHANGELOG.md
βββ CHANGELOG_KR.md
βββ MIGRATION_GUIDE.md
βββ MIGRATION_GUIDE_KR.md
# Create complete deployment package
release.batThe deployment package includes:
my-node-client-util-app.exe- Standalone executableconfig/- Configuration filestemplet/- Template filesrun.bat- Launcher script- Documentation files
- Batch files only run on Windows environment.
- Uses UTF-8 encoding for proper character output.
- Ensure Node.js is installed before execution.
- For distribution, copy the entire deployment folder to target machines.
This application supports internationalization with both Korean and English interfaces:
- English: This file (
README.md) - English documentation (main) - νκ΅μ΄ (Korean):
README_KR.md- Korean documentation
All user interface messages and logs are displayed in English when running the application.
If you're migrating from the previous separate utility scripts:
- The old individual scripts (
mssql-check,telnet-check,sql-exec) have been integrated into this unified application - All functionality is now available through the main menu system
- Configuration management has been centralized for better user experience
- Multi-database support has been added beyond just MSSQL