pragmaStatements method

Iterable<String> pragmaStatements({
  1. EncryptedSqliteVariant variant = EncryptedSqliteVariant.sqlite3MultipleCiphers,
})

Implementation

Iterable<String> pragmaStatements({
  EncryptedSqliteVariant variant =
      EncryptedSqliteVariant.sqlite3MultipleCiphers,
}) sync* {
  if (sqlcipherCompatibility &&
      variant == EncryptedSqliteVariant.sqlite3MultipleCiphers) {
    yield "PRAGMA cipher = 'sqlcipher'";
    yield 'PRAGMA legacy = 4';
  }

  // https://utelle.github.io/SQLite3MultipleCiphers/docs/configuration/config_sql_pragmas/#pragma-key--hexkey
  yield 'PRAGMA key = ${quoteString(key)}';
}