SQLiteDriver constructor

SQLiteDriver(
  1. DatabaseConnection connection
)

Implementation

SQLiteDriver(DatabaseConnection connection) {
  _db = sqlite3
      .open(connection.url ?? connection.database ?? 'database.sqlite');
  _insertDb = sqlite3
      .open(connection.url ?? connection.database ?? 'database.sqlite');
  _updateDb = sqlite3
      .open(connection.url ?? connection.database ?? 'database.sqlite');
  _deleteDb = sqlite3
      .open(connection.url ?? connection.database ?? 'database.sqlite');

  if (connection.foreignKeyConstraints ?? false) {
    _db?.execute('PRAGMA foreign_keys = ON;');
  }
  if (connection.busyTimeout != null) {
    _db?.execute('PRAGMA busy_timeout = ${connection.busyTimeout};');
  }
  _configuration = connection;
}