mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
rename encryption PRAGMA key to hexkey
This commit is contained in:
@@ -109,7 +109,7 @@ pub fn pragma_for(pragma: &PragmaName) -> Pragma {
|
||||
FreelistCount => Pragma::new(PragmaFlags::Result0, &["freelist_count"]),
|
||||
EncryptionKey => Pragma::new(
|
||||
PragmaFlags::Result0 | PragmaFlags::SchemaReq | PragmaFlags::NoColumns1,
|
||||
&["key"],
|
||||
&["hexkey"],
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1221,10 +1221,9 @@ pub enum PragmaName {
|
||||
IntegrityCheck,
|
||||
/// `journal_mode` pragma
|
||||
JournalMode,
|
||||
/// encryption key for encrypted databases. This is just called `key` because most
|
||||
/// extensions use this name instead of `encryption_key`.
|
||||
#[strum(serialize = "key")]
|
||||
#[cfg_attr(feature = "serde", serde(rename = "key"))]
|
||||
/// encryption key for encrypted databases, specified as hexadecimal string.
|
||||
#[strum(serialize = "hexkey")]
|
||||
#[cfg_attr(feature = "serde", serde(rename = "hexkey"))]
|
||||
EncryptionKey,
|
||||
/// Noop as per SQLite docs
|
||||
LegacyFileFormat,
|
||||
|
||||
@@ -16,7 +16,7 @@ fn test_per_page_encryption() -> anyhow::Result<()> {
|
||||
run_query(
|
||||
&tmp_db,
|
||||
&conn,
|
||||
"PRAGMA key = 'super secret key for encryption';",
|
||||
"PRAGMA hexkey = 'super secret key for encryption';",
|
||||
)?;
|
||||
run_query(
|
||||
&tmp_db,
|
||||
@@ -58,7 +58,7 @@ fn test_per_page_encryption() -> anyhow::Result<()> {
|
||||
run_query(
|
||||
&existing_db,
|
||||
&conn,
|
||||
"PRAGMA key = 'super secret key for encryption';",
|
||||
"PRAGMA hexkey = 'super secret key for encryption';",
|
||||
)?;
|
||||
run_query_on_row(&existing_db, &conn, "SELECT * FROM test", |row: &Row| {
|
||||
assert_eq!(row.get::<i64>(0).unwrap(), 1);
|
||||
|
||||
Reference in New Issue
Block a user