Skip to content

Commit

Permalink
db: disable DQS on Python >= 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
wisp3rwind committed Sep 30, 2024
1 parent 04ee041 commit 2ccca94
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions beets/dbcore/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os
import re
import sqlite3
import sys
import threading
import time
from abc import ABC
Expand Down Expand Up @@ -1091,6 +1092,12 @@ def _create_connection(self) -> Connection:
# call conn.close() in _close()
check_same_thread=False,
)

if sys.version_info >= (3, 12) and sqlite3.sqlite_version_info >= (3, 29, 0):
# If possible, disable double-quoted strings
conn.setconfig(sqlite3.SQLITE_DBCONFIG_DQS_DDL, 0)
conn.setconfig(sqlite3.SQLITE_DBCONFIG_DQS_DML, 0)

self.add_functions(conn)

if self.supports_extensions:
Expand Down

0 comments on commit 2ccca94

Please sign in to comment.