initialize
Initializes the SQLite database connection and creates required schema.
This method establishes the database connection, loads the SQLite JDBC driver, and ensures all required tables and indexes exist. The operation is performed asynchronously on the IO dispatcher to prevent blocking the calling coroutine.
Initialization Process:
Driver Loading: Loads
org.sqlite.JDBCdriver classConnection Establishment: Creates JDBC connection to SQLite database
Schema Creation: Executes DDL statements for tables and indexes
Validation: Confirms successful initialization with logging
Database Schema Created:
container_states: User state persistence with versioninginteraction_data: User interaction event loggingidx_interaction_user_timestamp: Performance optimization index
Error Handling:
ClassNotFoundException: SQLite JDBC driver not found in classpath
SQLException: Database connection or schema creation failure
Exception: General initialization errors with detailed logging
Threading Context:
Executes on Dispatchers.IO for non-blocking database operations
Safe to call from any coroutine context
See also
Schema creation implementation
Coroutine context for database operations
Throws
If database initialization fails for any reason