Add DatabaseHandle and DB utilities, integrate API

Introduce a DatabaseHandle wrapper and helper functions for opening and decrypting NTQQ SQLite DBs (openDatabase, decryptAndOpen) in napcat-database; expose them from the package index. Add typed query/execute helpers and SQLInputValue typing. Extend NTQQDatabaseApi in napcat-core to provide high-level methods (openDecryptedDb, openDatabase, query, queryOne, execute) and export DatabaseHandle. Replace disabled inline test blocks with runtime DatabaseApi usage in napcat-framework and napcat-shell to test/read nt_msg.db via the new API. Misc: small cleanup of imports and comments.
This commit is contained in:
手瓜一十雪 committed 2026-03-04 11:02:21 +08:00
1 parent b9dcedacf5
commit 0ddf21a2f5
5 files changed
+294 -37

No files matched your search

+3
View File
@@ -2,6 +2,9 @@ export { deriveKeys, type DerivedKeys } from './crypto';
export { decryptDatabase, decryptDatabaseFile, isEncryptedNTDB } from './decrypt';
export {
checkSqliteAvailable,
DatabaseHandle,
openDatabase,
decryptAndOpen,
listTablesFromBuffer,
listTablesFromFile,
readSingleDatabase,