without-durability-sqlite 0.0.4__tar.gz → 0.0.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {without_durability_sqlite-0.0.4 → without_durability_sqlite-0.0.6}/PKG-INFO +3 -2
- {without_durability_sqlite-0.0.4 → without_durability_sqlite-0.0.6}/pyproject.toml +8 -2
- {without_durability_sqlite-0.0.4 → without_durability_sqlite-0.0.6}/pyproject.toml.orig +4 -2
- {without_durability_sqlite-0.0.4 → without_durability_sqlite-0.0.6}/src/without_durability_sqlite/store.py +7 -2
- {without_durability_sqlite-0.0.4 → without_durability_sqlite-0.0.6}/README.md +0 -0
- {without_durability_sqlite-0.0.4 → without_durability_sqlite-0.0.6}/src/without_durability_sqlite/__init__.py +0 -0
- {without_durability_sqlite-0.0.4 → without_durability_sqlite-0.0.6}/src/without_durability_sqlite/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: without-durability-sqlite
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.6
|
|
4
4
|
Summary: A without-durability checkpoint store and queue backed by one SQLite file, with no server and no third-party driver.
|
|
5
5
|
Author: Josh Karpel
|
|
6
6
|
Author-email: Josh Karpel <josh.karpel@gmail.com>
|
|
@@ -14,7 +14,8 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.14
|
|
15
15
|
Classifier: Topic :: Software Development :: Libraries
|
|
16
16
|
Classifier: Typing :: Typed
|
|
17
|
-
Requires-Dist: without-
|
|
17
|
+
Requires-Dist: without-async==0.0.6
|
|
18
|
+
Requires-Dist: without-durability==0.0.6
|
|
18
19
|
Requires-Python: >=3.14
|
|
19
20
|
Description-Content-Type: text/markdown
|
|
20
21
|
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "without-durability-sqlite"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.6"
|
|
8
8
|
description = "A without-durability checkpoint store and queue backed by one SQLite file, with no server and no third-party driver."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -20,11 +20,17 @@ classifiers = [
|
|
|
20
20
|
"Topic :: Software Development :: Libraries",
|
|
21
21
|
"Typing :: Typed",
|
|
22
22
|
]
|
|
23
|
-
dependencies = [
|
|
23
|
+
dependencies = [
|
|
24
|
+
"without-async==0.0.6",
|
|
25
|
+
"without-durability==0.0.6",
|
|
26
|
+
]
|
|
24
27
|
|
|
25
28
|
[[project.authors]]
|
|
26
29
|
name = "Josh Karpel"
|
|
27
30
|
email = "josh.karpel@gmail.com"
|
|
28
31
|
|
|
32
|
+
[tool.uv.sources.without-async]
|
|
33
|
+
workspace = true
|
|
34
|
+
|
|
29
35
|
[tool.uv.sources.without-durability]
|
|
30
36
|
workspace = true
|
|
@@ -4,7 +4,7 @@ build-backend = "uv_build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "without-durability-sqlite"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.6"
|
|
8
8
|
description = "A without-durability checkpoint store and queue backed by one SQLite file, with no server and no third-party driver."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -24,8 +24,10 @@ classifiers = [
|
|
|
24
24
|
"Typing :: Typed",
|
|
25
25
|
]
|
|
26
26
|
dependencies = [
|
|
27
|
-
"without-
|
|
27
|
+
"without-async==0.0.6",
|
|
28
|
+
"without-durability==0.0.6",
|
|
28
29
|
]
|
|
29
30
|
|
|
30
31
|
[tool.uv.sources]
|
|
32
|
+
without-async = { workspace = true }
|
|
31
33
|
without-durability = { workspace = true }
|
|
@@ -65,6 +65,7 @@ from pathlib import Path
|
|
|
65
65
|
from time import monotonic
|
|
66
66
|
from typing import cast
|
|
67
67
|
|
|
68
|
+
from without_async import Milliseconds
|
|
68
69
|
from without_durability.codec import JSON
|
|
69
70
|
from without_durability.codec import CheckpointCodec
|
|
70
71
|
from without_durability.interfaces import LEASE
|
|
@@ -81,6 +82,10 @@ from without_durability.stepwise import now_utc
|
|
|
81
82
|
# the worker takes for exactly as long).
|
|
82
83
|
POLL = timedelta(milliseconds=50)
|
|
83
84
|
|
|
85
|
+
# How long a process finding the write lock taken waits for it, in the unit
|
|
86
|
+
# `PRAGMA busy_timeout` carries. A frozen count is a value, so one serves every caller.
|
|
87
|
+
BUSY_TIMEOUT = Milliseconds(5_000)
|
|
88
|
+
|
|
84
89
|
# `value` is TEXT rather than a richer type, which is the same shape the Redis store's
|
|
85
90
|
# hash field has and leaves the same question open: what goes *in* the text is the
|
|
86
91
|
# store's injected `CheckpointCodec`, defaulting to JSON because that is what makes a
|
|
@@ -302,7 +307,7 @@ class Database:
|
|
|
302
307
|
await asyncio.to_thread(self.connection.close)
|
|
303
308
|
|
|
304
309
|
|
|
305
|
-
def connect(path: Path | str, *, timeout:
|
|
310
|
+
def connect(path: Path | str, *, timeout: Milliseconds = BUSY_TIMEOUT) -> Database:
|
|
306
311
|
"""
|
|
307
312
|
Open the database this store runs on, configured for durability rather than speed.
|
|
308
313
|
|
|
@@ -323,7 +328,7 @@ def connect(path: Path | str, *, timeout: timedelta = timedelta(seconds=5)) -> D
|
|
|
323
328
|
connection = sqlite3.connect(path, autocommit=True, check_same_thread=False)
|
|
324
329
|
connection.execute("PRAGMA journal_mode = WAL")
|
|
325
330
|
connection.execute("PRAGMA synchronous = FULL")
|
|
326
|
-
connection.execute(f"PRAGMA busy_timeout = {
|
|
331
|
+
connection.execute(f"PRAGMA busy_timeout = {timeout.count}")
|
|
327
332
|
return Database(connection=connection)
|
|
328
333
|
|
|
329
334
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|