dirsql 0.3.33__tar.gz → 0.3.35__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.
- {dirsql-0.3.33 → dirsql-0.3.35}/Cargo.lock +1 -1
- {dirsql-0.3.33 → dirsql-0.3.35}/PKG-INFO +1 -1
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/_async.py +23 -3
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/_dirsql.pyi +4 -1
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/resolve_config.py +5 -1
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/Cargo.toml +1 -1
- {dirsql-0.3.33 → dirsql-0.3.35}/pyproject.toml +4 -3
- {dirsql-0.3.33 → dirsql-0.3.35}/Cargo.toml +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/README.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/__init__.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/__init__.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/binary_path.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/interpret/__init__.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/interpret/dispatch_extract.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/interpret/load_app.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/interpret/run.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/interpret/write_message.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/is_windows.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/cli/main.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/dirsql/py.typed +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/.vitepress/config.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/AGENTS.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/api/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/cli/config.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/cli/http-api.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/cli/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/cli/init.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/cli/server.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/getting-started.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/guide/async.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/guide/crdt.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/guide/persistence.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/guide/querying.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/guide/tables.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/guide/watching.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/migrations.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/package.json +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/playwright.config.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/docs/vitest.config.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/README.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/conftest.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/.claude/CLAUDE.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/.vitepress/config.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/.vitepress/theme/index.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/.vitepress/theme/lang.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/AGENTS.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/api/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/cli/config.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/cli/http-api.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/cli/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/cli/init.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/cli/server.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/getting-started.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/guide/async.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/guide/crdt.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/guide/persistence.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/guide/querying.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/guide/tables.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/guide/watching.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/migrations.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/package.json +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/playwright.config.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/pnpm-lock.yaml +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/pnpm-workspace.yaml +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/tests/integration/home.spec.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/tests/integration/language-flag.spec.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/tests/unit/config.test.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/tests/unit/lang.test.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/vitest.config.ts +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/src/lib.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/__init__.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/conftest.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/e2e/__init__.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/data/a/meta.json +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/data/b/meta.json +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/dirsql.config.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/interpret/data/a/meta.json +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/interpret/data/b/meta.json +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/interpret/dirsql.config.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/interpret/dirsql.config_no_app.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/interpret/dirsql.config_raises.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__init__.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/interpret_subprocess.py +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/Cargo.toml +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/README.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/benches/db_bench.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/benches/differ_bench.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/benches/matcher_bench.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/benches/scanner_bench.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/api/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/cli/config.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/cli/http-api.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/cli/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/cli/init.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/cli/server.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/getting-started.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/guide/async.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/guide/crdt.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/guide/persistence.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/guide/querying.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/guide/tables.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/guide/watching.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/index.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/docs/migrations.md +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/bin/dirsql.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/cli/init.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/cli/mod.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/cli/native_config.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/cli/router.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/cli/serialize.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/cli/server.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/config.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/db.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/differ.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/lib.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/matcher.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/persist.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/scanner.rs +0 -0
- {dirsql-0.3.33 → dirsql-0.3.35}/packages/rust/src/watcher.rs +0 -0
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
"""Async-by-default DirSQL wrapper."""
|
|
2
2
|
|
|
3
3
|
import asyncio
|
|
4
|
+
from typing import TYPE_CHECKING
|
|
4
5
|
|
|
5
6
|
from dirsql._dirsql import DirSQL as _RustDirSQL
|
|
6
7
|
from dirsql.resolve_config import resolve_config
|
|
7
8
|
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
# `typing.override` is 3.12+; the package supports 3.11, so source it from
|
|
11
|
+
# `typing_extensions` for the type checker only. At runtime `@override` is
|
|
12
|
+
# a pure marker, so a no-op identity avoids the runtime dependency.
|
|
13
|
+
from typing_extensions import override
|
|
14
|
+
else:
|
|
15
|
+
|
|
16
|
+
def override(func):
|
|
17
|
+
return func
|
|
18
|
+
|
|
8
19
|
|
|
9
20
|
class _WatchStream:
|
|
10
21
|
"""Async iterator that polls for file events."""
|
|
@@ -111,15 +122,24 @@ class DirSQL:
|
|
|
111
122
|
raise self._init_error
|
|
112
123
|
|
|
113
124
|
async def query(self, sql):
|
|
114
|
-
"""Execute a SQL query asynchronously.
|
|
115
|
-
|
|
125
|
+
"""Execute a SQL query asynchronously.
|
|
126
|
+
|
|
127
|
+
Awaits :meth:`ready` first, so calling ``query`` before an explicit
|
|
128
|
+
``await db.ready()`` waits for the background scan (and re-raises any
|
|
129
|
+
initialization error) instead of failing on a still-``None`` ``_db``.
|
|
130
|
+
"""
|
|
131
|
+
await self.ready()
|
|
132
|
+
db = self._db
|
|
133
|
+
assert db is not None # ready() returned, so _init_bg set _db
|
|
134
|
+
return await asyncio.to_thread(db.query, sql)
|
|
116
135
|
|
|
117
136
|
def watch(self):
|
|
118
137
|
"""Start watching for file changes. Returns an async iterable of RowEvent."""
|
|
119
138
|
return _WatchStream(self._db)
|
|
120
139
|
|
|
121
140
|
@property
|
|
122
|
-
|
|
141
|
+
@override
|
|
142
|
+
def __dict__(self):
|
|
123
143
|
"""Resolved construction state as a JSON-serializable dict.
|
|
124
144
|
|
|
125
145
|
Recomputed on each access; reads the ``.dirsql.toml`` if ``config=``
|
|
@@ -13,6 +13,8 @@ from collections.abc import Callable
|
|
|
13
13
|
from os import PathLike
|
|
14
14
|
from typing import Any, NotRequired, TypedDict
|
|
15
15
|
|
|
16
|
+
from typing_extensions import override
|
|
17
|
+
|
|
16
18
|
__version__: str
|
|
17
19
|
|
|
18
20
|
Row = dict[str, Any]
|
|
@@ -51,7 +53,8 @@ class RowEvent:
|
|
|
51
53
|
error: str | None
|
|
52
54
|
file_path: str | None
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
@override
|
|
57
|
+
def __repr__(self) -> str: ...
|
|
55
58
|
|
|
56
59
|
class DirSQL:
|
|
57
60
|
"""Synchronous binding class. ``dirsql._async.DirSQL`` wraps it."""
|
|
@@ -23,7 +23,11 @@ def resolve_config(
|
|
|
23
23
|
cfg_dir = os.path.dirname(os.path.abspath(config))
|
|
24
24
|
|
|
25
25
|
def _abs(p):
|
|
26
|
-
|
|
26
|
+
# Only reached from the `"<key>" in cfg` branches below, and cfg is
|
|
27
|
+
# non-empty only after a config file was loaded -- which sets cfg_dir.
|
|
28
|
+
base = cfg_dir
|
|
29
|
+
assert base is not None
|
|
30
|
+
return p if os.path.isabs(p) else os.path.join(base, p)
|
|
27
31
|
|
|
28
32
|
return {
|
|
29
33
|
"root": root or (_abs(cfg["root"]) if "root" in cfg else cfg_dir),
|
|
@@ -4,7 +4,7 @@ name = "dirsql-py-ext"
|
|
|
4
4
|
# pypi/maturin handler can rewrite it via `write-version` before
|
|
5
5
|
# `maturin build`. `pyproject.toml` declares `dynamic = ["version"]`
|
|
6
6
|
# and maturin reads this field. Mirrors `packages/rust/Cargo.toml`.
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.35"
|
|
8
8
|
edition.workspace = true
|
|
9
9
|
publish = false
|
|
10
10
|
readme = "README.md"
|
|
@@ -65,9 +65,10 @@ include = [
|
|
|
65
65
|
]
|
|
66
66
|
manifest-path = "packages/python/Cargo.toml"
|
|
67
67
|
|
|
68
|
-
# Type checking.
|
|
69
|
-
# `# ty: ignore[...]` baseline
|
|
70
|
-
# any new error in new or touched code fails CI
|
|
68
|
+
# Type checking. The source tree currently type-checks clean: the initial
|
|
69
|
+
# `# ty: ignore[...]` baseline (seeded by `ty check --add-ignore`) has been
|
|
70
|
+
# driven to zero, so any new error in new or touched code fails CI with no
|
|
71
|
+
# pre-existing suppressions to hide behind. Every rule is promoted to
|
|
71
72
|
# `"error"`, matching TypeScript-strict discipline. Test files are excluded
|
|
72
73
|
# because they monkeypatch fakes onto production module attributes
|
|
73
74
|
# (`monkeypatch.setattr(async_mod, "_RustDirSQL", ...)`) -- AGENTS.md flags
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dirsql-0.3.33 → dirsql-0.3.35}/packages/python/docs/tests/integration/language-flag.spec.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/data/a/meta.json
RENAMED
|
File without changes
|
{dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/data/b/meta.json
RENAMED
|
File without changes
|
{dirsql-0.3.33 → dirsql-0.3.35}/packages/python/tests/integration/__fixtures__/dirsql.config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|