mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 04:58:47 +03:00
refactor(sql): disable double-quoted string literals
Double-quoted string literals are not standard and may be accidentally treated as an identifier if there is an identifier with the same name as the string contents: https://sqlite.org/quirks.html#double_quoted_string_literals_are_accepted
This commit is contained in:
@@ -5021,7 +5021,7 @@ pub(crate) async fn delete_and_reset_all_device_msgs(context: &Context) -> Resul
|
|||||||
context
|
context
|
||||||
.sql
|
.sql
|
||||||
.execute(
|
.execute(
|
||||||
r#"INSERT INTO devmsglabels (label) VALUES ("core-welcome-image"), ("core-welcome")"#,
|
"INSERT INTO devmsglabels (label) VALUES ('core-welcome-image'), ('core-welcome')",
|
||||||
(),
|
(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
|||||||
@@ -741,6 +741,11 @@ fn new_connection(path: &Path, passphrase: &str) -> Result<Connection> {
|
|||||||
// Default synchronous=FULL is much slower. NORMAL is sufficient for WAL mode.
|
// Default synchronous=FULL is much slower. NORMAL is sufficient for WAL mode.
|
||||||
conn.pragma_update(None, "synchronous", "NORMAL".to_string())?;
|
conn.pragma_update(None, "synchronous", "NORMAL".to_string())?;
|
||||||
|
|
||||||
|
// Disable double-quoted string literals misfeature.
|
||||||
|
// <https://sqlite.org/quirks.html#double_quoted_string_literals_are_accepted>
|
||||||
|
conn.set_db_config(DbConfig::SQLITE_DBCONFIG_DQS_DML, false)?;
|
||||||
|
conn.set_db_config(DbConfig::SQLITE_DBCONFIG_DQS_DDL, false)?;
|
||||||
|
|
||||||
Ok(conn)
|
Ok(conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user