mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-28 00:14:21 +00:00
add database connect config
This commit is contained in:
@@ -38,9 +38,12 @@ class PersistenceManager:
|
||||
async def initialize(self):
|
||||
self.ap.logger.info('Initializing database...')
|
||||
|
||||
database_type = self.ap.instance_config.data['system'].get('database', {}).get('type', 'sqlite')
|
||||
for manager in database.preregistered_managers:
|
||||
self.db = manager(self.ap)
|
||||
await self.db.initialize()
|
||||
if manager.name == database_type:
|
||||
self.db = manager(self.ap)
|
||||
await self.db.initialize()
|
||||
break
|
||||
|
||||
await self.create_tables()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user