Coverage for src / local_deep_research / database / sqlcipher_compat.py: 67%
6 statements
« prev ^ index » next coverage.py v7.12.0, created at 2026-01-11 00:51 +0000
« prev ^ index » next coverage.py v7.12.0, created at 2026-01-11 00:51 +0000
1"""
2SQLCipher compatibility module for cross-platform support.
4Provides a unified interface for importing SQLCipher on different platforms:
5- x86_64 Linux: Uses sqlcipher3-binary (pre-compiled wheel)
6- ARM64 Linux: Uses sqlcipher3 (builds from source)
7- Other platforms: Uses sqlcipher3
8"""
11def get_sqlcipher_module():
12 """
13 Get the appropriate SQLCipher module for the current platform.
15 Returns the sqlcipher3 module (either sqlcipher3-binary or sqlcipher3
16 depending on platform and what's installed).
18 Returns:
19 module: The sqlcipher module with dbapi2 attribute
21 Raises:
22 ImportError: If sqlcipher3 is not available
23 """
24 try:
25 import sqlcipher3
27 return sqlcipher3
28 except ImportError:
29 raise ImportError(
30 "sqlcipher3 is not installed. "
31 "Ensure SQLCipher system library is installed, then run: pdm install"
32 )