-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Description
When using the connection pool configuration in the database library, it causes "table not found" errors for tables that should exist. This affects both the auth system tables and regular database operations.
Error Messages
Error querying items: [Error: select * from `api_keys` - SQLITE_ERROR: no such table: api_keys] {
errno: 1,
code: 'SQLITE_ERROR'
}
Error: select * from `auth_config` order by `created_at` desc limit 1 - SQLITE_ERROR: no such table: auth_config
Session verification error: [Error: select * from `internal_admin_sessions` where `token` = '...' and `expires_at` > CURRENT_TIMESTAMP limit 1 - SQLITE_ERROR: no such table: internal_admin_sessions] {
errno: 1,
code: 'SQLITE_ERROR'
}
Steps to Reproduce
- Configure the database with connection pool settings:
pool: {
min: 0,
max: 10,
acquireTimeoutMillis: 60000, // 60 seconds
createTimeoutMillis: 30000,
idleTimeoutMillis: 30000,
reapIntervalMillis: 1000,
createRetryIntervalMillis: 100,
}- Attempt to access auth tables or perform database operations
- Observe "table not found" errors
Expected Behavior
The database should be able to find and access all tables regardless of the connection pool configuration.
Possible Causes
- Connection pool might be creating separate database connections that don't share the same schema
- SQLite in-memory database might not be properly shared across connections
- Transaction handling might be interfering with table access
Potential Solutions
- Modify the connection pool configuration to be compatible with SQLite
- Implement a shared connection strategy for SQLite in-memory databases
- Review and update the transaction implementation to ensure proper table access