Skip to content

Commit bb20c60

Browse files
thejchapclaude
andcommitted
document check_same_thread default for web frameworks
add explanation in docstring for why check_same_thread defaults to False, referencing fastapi documentation on sql databases 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f3e614b commit bb20c60

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/sapling/backends/sqlite.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ class SQLiteBackend(Backend):
3939
by sqlite are looked up to be converted to python types
4040
isolation_level: control legacy transaction handling behavior.
4141
can be "DEFERRED", "IMMEDIATE", "EXCLUSIVE", or None for autocommit
42-
check_same_thread: if True, only the creating thread may use the connection
42+
check_same_thread: if True, only the creating thread may use the connection.
43+
defaults to False to support web frameworks like fastapi where requests
44+
are handled in different threads. see:
45+
https://fastapi.tiangolo.com/tutorial/sql-databases/#create-models
4346
cached_statements: number of statements that sqlite should internally cache
4447
uri: if True, path is interpreted as a URI with a file path and optional
4548
query string

0 commit comments

Comments
 (0)