feat: implement database service with SQL Server and MySQL support

- Add database types (QueryResult, TransactionResult)
- Implement DatabaseService with connection management for SQL Server and MySQL
- Add query execution methods for both database types
- Include comprehensive error handling and logging
- Add unit test for error handling
- Configure Jest for testing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-02-28 22:28:02 +08:00
parent 7cfbce7505
commit 351c7857cb
4 changed files with 152 additions and 0 deletions

8
jest.config.js Normal file
View File

@@ -0,0 +1,8 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/tests'],
testMatch: ['**/*.test.ts'],
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],
moduleFileExtensions: ['ts', 'js', 'json'],
};