createTable method
Create the sessions table if it doesn't exist Note: This uses raw SQL for simplicity. In the future, this could be updated to use the SchemaBuilder for better database abstraction.
Implementation
Future<void> createTable() async {
// Use database-agnostic SQL that works across different database types
final createTableSql = '''
CREATE TABLE IF NOT EXISTS $_tableName (
session_id VARCHAR(255) PRIMARY KEY,
payload TEXT NOT NULL,
last_activity TEXT NOT NULL,
created_at TEXT DEFAULT CURRENT_TIMESTAMP
)
''';
await _connection.execute(createTableSql);
}