qodalis-cli-server-plugin-filesystem-sqlite 1.0.0b1__tar.gz → 1.0.0b5__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.
- {qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b1 → qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b5}/.gitignore +1 -0
- {qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b1 → qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b5}/PKG-INFO +1 -1
- {qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b1 → qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b5}/pyproject.toml +1 -1
- {qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b1 → qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b5}/qodalis_cli_filesystem_sqlite/sqlite_provider.py +3 -6
- {qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b1 → qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b5}/LICENSE +0 -0
- {qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b1 → qodalis_cli_server_plugin_filesystem_sqlite-1.0.0b5}/qodalis_cli_filesystem_sqlite/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qodalis-cli-server-plugin-filesystem-sqlite
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0b5
|
|
4
4
|
Summary: SQLite-based storage provider for the Qodalis CLI filesystem plugin
|
|
5
5
|
Project-URL: Homepage, https://github.com/qodalis-solutions/cli-server-python
|
|
6
6
|
Project-URL: Repository, https://github.com/qodalis-solutions/cli-server-python
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "qodalis-cli-server-plugin-filesystem-sqlite"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.0b5"
|
|
8
8
|
description = "SQLite-based storage provider for the Qodalis CLI filesystem plugin"
|
|
9
9
|
readme = { text = "", content-type = "text/plain" }
|
|
10
10
|
license = "MIT"
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"""SQLite-backed file storage provider."""
|
|
2
|
+
|
|
1
3
|
from __future__ import annotations
|
|
2
4
|
|
|
3
5
|
import os
|
|
@@ -88,7 +90,6 @@ class SqliteFileStorageProvider(IFileStorageProvider):
|
|
|
88
90
|
options = SqliteProviderOptions()
|
|
89
91
|
self._db_path = options.db_path
|
|
90
92
|
|
|
91
|
-
# Create parent directories for on-disk databases
|
|
92
93
|
if self._db_path != ":memory:":
|
|
93
94
|
parent_dir = os.path.dirname(self._db_path)
|
|
94
95
|
if parent_dir:
|
|
@@ -101,10 +102,10 @@ class SqliteFileStorageProvider(IFileStorageProvider):
|
|
|
101
102
|
self._conn.execute(_CREATE_INDEX)
|
|
102
103
|
self._conn.commit()
|
|
103
104
|
|
|
104
|
-
# Ensure root directory exists
|
|
105
105
|
self._ensure_root()
|
|
106
106
|
|
|
107
107
|
def _ensure_root(self) -> None:
|
|
108
|
+
"""Insert the root directory row if it does not exist."""
|
|
108
109
|
row = self._conn.execute(
|
|
109
110
|
"SELECT id FROM files WHERE path = ?", ("/",)
|
|
110
111
|
).fetchone()
|
|
@@ -117,8 +118,6 @@ class SqliteFileStorageProvider(IFileStorageProvider):
|
|
|
117
118
|
)
|
|
118
119
|
self._conn.commit()
|
|
119
120
|
|
|
120
|
-
# -- IFileStorageProvider interface ----------------------------------------
|
|
121
|
-
|
|
122
121
|
@property
|
|
123
122
|
def name(self) -> str:
|
|
124
123
|
return "sqlite"
|
|
@@ -380,8 +379,6 @@ class SqliteFileStorageProvider(IFileStorageProvider):
|
|
|
380
379
|
async def upload_file(self, path: str, content: bytes) -> None:
|
|
381
380
|
await self.write_file(path, content)
|
|
382
381
|
|
|
383
|
-
# -- Private helpers -------------------------------------------------------
|
|
384
|
-
|
|
385
382
|
async def _ensure_parents(self, path: str) -> None:
|
|
386
383
|
"""Ensure all ancestor directories exist up to and including *path*."""
|
|
387
384
|
norm = _normalize_path(path)
|
|
File without changes
|