From ed19ef712794281f982983a58976ba1829f30496 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Feb 2026 08:24:25 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20=E3=83=89=E3=82=AD=E3=83=A5=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=A8=E8=A8=AD=E5=AE=9A=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=81=AE=E6=95=B4=E5=90=88=E6=80=A7=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - .desktop: Exec=sqliteviewer → sqliteview に修正(pyproject.toml と一致) - pyproject.toml: プレースホルダー URL を実際の GitHub URL に更新 - docs/architecture.md: ビルドバックエンド(hatchling)、コマンド名(sqliteview)を修正、テーマ・ハイライター・書き込みサポートの記述を追加 - docs/assumptions.md: Ubuntu限定→クロスプラットフォーム対応に更新 - README.md/README_ja.md: Phase 2新機能(ダークモード・ショートカット等)と書き込みサポートを追記、テスト・ビルドコマンドをuv準拠に更新 - egg-info: 古いビルドキャッシュ(v0.1.0)をgit追跡から除外 https://claude.ai/code/session_01K6F6h9AYpjGQ8mhhFQNdwe --- README.md | 9 +- README_ja.md | 9 +- docs/architecture.md | 17 ++- docs/assumptions.md | 12 +- pyproject.toml | 4 +- src/sqliteviewer.egg-info/PKG-INFO | 106 ------------------ src/sqliteviewer.egg-info/SOURCES.txt | 23 ---- .../dependency_links.txt | 1 - src/sqliteviewer.egg-info/entry_points.txt | 2 - src/sqliteviewer.egg-info/requires.txt | 7 -- src/sqliteviewer.egg-info/top_level.txt | 1 - .../resources/sqliteviewer.desktop | 2 +- 12 files changed, 36 insertions(+), 157 deletions(-) delete mode 100644 src/sqliteviewer.egg-info/PKG-INFO delete mode 100644 src/sqliteviewer.egg-info/SOURCES.txt delete mode 100644 src/sqliteviewer.egg-info/dependency_links.txt delete mode 100644 src/sqliteviewer.egg-info/entry_points.txt delete mode 100644 src/sqliteviewer.egg-info/requires.txt delete mode 100644 src/sqliteviewer.egg-info/top_level.txt diff --git a/README.md b/README.md index 831f4c2..768e8ed 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ A lightweight, cross-platform PyQt6 desktop SQLite database viewer. The app lets - Browse tables and view row data with pagination - Run custom SQL queries with syntax highlighting and CSV export +- Execute write operations (INSERT, UPDATE, DELETE) and DDL (CREATE, DROP, ALTER) +- Destructive query confirmation dialog for safety +- Light/Dark theme switching (Ctrl+D) with persistent preference +- Monospace font in SQL editor and schema view +- Keyboard shortcuts: Ctrl+Enter / F5 (run query), Ctrl+R (refresh tables) - Display table schema metadata - Persistent recent files list for quick access - Debian package builder for Ubuntu (Python-dependent bundle) @@ -89,12 +94,12 @@ sqliteview /path/to/database.sqlite ## Running Tests ```bash -pytest +uv run python -m pytest tests/ -v ``` ## Packaging -- Build wheel + sdist: `python -m build` +- Build wheel + sdist: `uv run python -m build` - Build Debian package: `./scripts/build_deb.sh` - Generated packages are placed in `dist/` diff --git a/README_ja.md b/README_ja.md index 4286486..ac1f5d4 100644 --- a/README_ja.md +++ b/README_ja.md @@ -8,6 +8,11 @@ - ページネーション付きでテーブルを閲覧し、行データを表示 - シンタックスハイライトとCSVエクスポート機能を備えたカスタムSQLクエリの実行 +- 書き込み操作(INSERT, UPDATE, DELETE)およびDDL(CREATE, DROP, ALTER)の実行 +- 破壊的クエリの安全確認ダイアログ +- ライト/ダークテーマの切替(Ctrl+D)と設定の永続化 +- SQLエディタ・スキーマ表示のモノスペースフォント +- キーボードショートカット: Ctrl+Enter / F5(クエリ実行)、Ctrl+R(テーブルリフレッシュ) - テーブルスキーマのメタデータを表示 - 素早いアクセスのための最近使用したファイル一覧の永続化 - Ubuntu用のDebianパッケージビルダー(Python依存バンドル) @@ -89,12 +94,12 @@ sqliteview /path/to/database.sqlite ## テストの実行 ```bash -pytest +uv run python -m pytest tests/ -v ``` ## パッケージング -- wheel + sdist のビルド: `python -m build` +- wheel + sdist のビルド: `uv run python -m build` - Debian パッケージのビルド: `./scripts/build_deb.sh` - 生成されたパッケージは `dist/` に配置されます diff --git a/docs/architecture.md b/docs/architecture.md index 5f65f54..8bcdf63 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -9,10 +9,19 @@ - Implements the main window, table browser, query editor, and result views using PyQt6 widgets. - Separates UI widgets from data access via signal/slot connections. 3. **Data access layer (`sqliteviewer.database`)** - - Provides `DatabaseService` for opening SQLite files, listing tables, describing schemas, executing queries, and streaming rows. + - Provides `DatabaseService` for opening SQLite files, listing tables, describing schemas, executing queries (read and write), and streaming rows. + - Supports DML (INSERT/UPDATE/DELETE), DDL (CREATE/DROP/ALTER), and TCL (BEGIN/COMMIT/ROLLBACK). + - Includes query classification (`classify_query`) and destructive operation detection (`is_destructive_query`) with SQL noise stripping for safe keyword matching. - Includes pragmatic safeguards (e.g., limiting returned rows) to keep the UI responsive. -4. **Utility module (`sqliteviewer.resources`)** +4. **Theme system (`sqliteviewer.theme`)** + - Manages light/dark theme switching via QSS stylesheets. + - Persists user preference via `QSettings`. +5. **SQL syntax highlighter (`sqliteviewer.sql_highlighter`)** + - Provides real-time syntax highlighting for the query editor. + - Supports theme-aware color schemes (light/dark). +6. **Utility module (`sqliteviewer.resources`)** - Manages application metadata, version, and icon loading. + - Includes QSS theme files (`light.qss`, `dark.qss`) and desktop integration assets. ## Data flow @@ -24,8 +33,8 @@ Results are translated into Qt models (`QStandardItemModel`) before reaching the ## Packaging & distribution -- Python packaging via `pyproject.toml` (setuptools backend). -- CLI/desktop entry point exposed as `sqliteviewer` console script. +- Python packaging via `pyproject.toml` (hatchling backend). +- CLI/desktop entry point exposed as `sqliteview` console script. - Debian packaging script (`scripts/build_deb.sh`) leverages `python -m build` and `dpkg-deb` to produce `.deb` including bundled dependencies. - Desktop integration provides `.desktop` launcher and application icon installed by the Debian package. diff --git a/docs/assumptions.md b/docs/assumptions.md index 83ff56d..d736709 100644 --- a/docs/assumptions.md +++ b/docs/assumptions.md @@ -1,10 +1,10 @@ -# Assumptions for Ubuntu SQLite Viewer +# Assumptions for SQLite View -- Target platform is Ubuntu 22.04 LTS or newer with Python >= 3.10 preinstalled. -- End users install the application on desktop environments where X11/Wayland is available for GUI rendering. -- PyQt6 wheels are acceptable for bundling within the Debian package; no system Qt dependencies are required. +- Primary target platforms are Ubuntu/Linux (primary development), Windows (confirmed working), and macOS (untested). Python >= 3.10 is required. +- End users install the application on desktop environments where X11/Wayland (Linux) or native window system (Windows/macOS) is available for GUI rendering. +- PyQt6 wheels are acceptable for bundling within the Debian package; no system Qt dependencies are required. On Windows, PyQt6 bundles all necessary dependencies. - Users operate on local SQLite databases; remote connections are out of scope. - Database files are expected to fit in memory for paging 1,000-row chunks; extremely large tables may require streaming in a future iteration. -- Packaging leverages native Python tooling and `dpkg-deb`; `fpm` or other third-party packagers are not required on target systems. +- Debian packaging leverages native Python tooling and `dpkg-deb`; `fpm` or other third-party packagers are not required on target systems. - CI runs on GitHub-hosted Ubuntu runners with internet access to install Python dependencies. -- Application internationalization/localization is not required for this release; English-only UI is acceptable. +- UI is English-only. Japanese documentation (`README_ja.md`) is provided separately. diff --git a/pyproject.toml b/pyproject.toml index 7b946cb..997bb5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,8 +39,8 @@ dev = [ ] [project.urls] -Homepage = "https://example.com/sqliteviewer" -Repository = "https://example.com/sqliteviewer/repo" +Homepage = "https://github.com/kwrkb/SQLiteView" +Repository = "https://github.com/kwrkb/SQLiteView" [project.scripts] sqliteview = "sqliteviewer.__main__:main" diff --git a/src/sqliteviewer.egg-info/PKG-INFO b/src/sqliteviewer.egg-info/PKG-INFO deleted file mode 100644 index 2c29e15..0000000 --- a/src/sqliteviewer.egg-info/PKG-INFO +++ /dev/null @@ -1,106 +0,0 @@ -Metadata-Version: 2.4 -Name: sqliteviewer -Version: 0.1.0 -Summary: PyQt6-based SQLite viewer for Ubuntu -Author-email: SQLite Viewer Team -License: MIT License - - Copyright (c) 2024 SQLite Viewer - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. - -Project-URL: Homepage, https://example.com/sqliteviewer -Project-URL: Repository, https://example.com/sqliteviewer/repo -Keywords: sqlite,viewer,pyqt6,ubuntu -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.10 -Classifier: License :: OSI Approved :: MIT License -Classifier: Operating System :: POSIX :: Linux -Classifier: Environment :: X11 Applications :: Qt -Classifier: Topic :: Database -Requires-Python: >=3.10 -Description-Content-Type: text/markdown -License-File: LICENSE -License-File: LICENSE_ja -Requires-Dist: PyQt6>=6.6 -Provides-Extra: dev -Requires-Dist: pytest>=7.4; extra == "dev" -Requires-Dist: pytest-qt>=4.2; extra == "dev" -Requires-Dist: python-dotenv>=1.0; extra == "dev" -Requires-Dist: build>=1.0.3; extra == "dev" -Dynamic: license-file - -# SQLite Viewer for Ubuntu - -A lightweight PyQt6 desktop SQLite database viewer targeting Ubuntu desktops. The app lets you inspect tables, run ad-hoc queries, and export results—packaged for distribution via Python wheels or Debian packages. - -## Features - -- Browse tables and view row data with pagination -- Run custom SQL queries with syntax highlighting and CSV export -- Display table schema metadata -- Persistent recent files list for quick access -- Debian package builder for Ubuntu (Python-dependent bundle) - -## Prerequisites - -This application requires the following system libraries to be installed on Ubuntu: - -```bash -sudo apt-get update -sudo apt-get install -y libxcb-cursor0 libxkbcommon-x11-0 libxcb-icccm4 libxcb-keysyms1 libxcb-xkb1 -``` - -## Getting Started - -```bash -# create & activate a virtual environment -python3 -m venv .venv -source .venv/bin/activate - -# install in editable mode with dev extras -pip install --upgrade pip -pip install -e ".[dev]" -``` - -Launch the viewer: - -```bash -sqliteviewer /path/to/database.sqlite -``` - -## Running Tests - -```bash -pytest -``` - -## Packaging - -- Build wheel + sdist: `python -m build` -- Build Debian package: `./scripts/build_deb.sh` -- Generated packages are placed in `dist/` - -## Continuous Integration - -GitHub Actions workflow (`.github/workflows/ci.yml`) validates formatting, runs tests, and ensures packaging succeeds on Ubuntu. - -## License - -Released under the MIT License. See [LICENSE](LICENSE). diff --git a/src/sqliteviewer.egg-info/SOURCES.txt b/src/sqliteviewer.egg-info/SOURCES.txt deleted file mode 100644 index 92c1852..0000000 --- a/src/sqliteviewer.egg-info/SOURCES.txt +++ /dev/null @@ -1,23 +0,0 @@ -LICENSE -LICENSE_ja -MANIFEST.in -README.md -pyproject.toml -docs/architecture.md -docs/assumptions.md -src/sqliteviewer/__init__.py -src/sqliteviewer/__main__.py -src/sqliteviewer/app.py -src/sqliteviewer/database.py -src/sqliteviewer/mainwindow.py -src/sqliteviewer/sql_highlighter.py -src/sqliteviewer.egg-info/PKG-INFO -src/sqliteviewer.egg-info/SOURCES.txt -src/sqliteviewer.egg-info/dependency_links.txt -src/sqliteviewer.egg-info/entry_points.txt -src/sqliteviewer.egg-info/requires.txt -src/sqliteviewer.egg-info/top_level.txt -src/sqliteviewer/resources/__init__.py -src/sqliteviewer/resources/icon.png -src/sqliteviewer/resources/sqliteviewer.desktop -tests/test_database.py \ No newline at end of file diff --git a/src/sqliteviewer.egg-info/dependency_links.txt b/src/sqliteviewer.egg-info/dependency_links.txt deleted file mode 100644 index 8b13789..0000000 --- a/src/sqliteviewer.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/sqliteviewer.egg-info/entry_points.txt b/src/sqliteviewer.egg-info/entry_points.txt deleted file mode 100644 index d3e50ba..0000000 --- a/src/sqliteviewer.egg-info/entry_points.txt +++ /dev/null @@ -1,2 +0,0 @@ -[console_scripts] -sqliteviewer = sqliteviewer.__main__:main diff --git a/src/sqliteviewer.egg-info/requires.txt b/src/sqliteviewer.egg-info/requires.txt deleted file mode 100644 index 5807b48..0000000 --- a/src/sqliteviewer.egg-info/requires.txt +++ /dev/null @@ -1,7 +0,0 @@ -PyQt6>=6.6 - -[dev] -pytest>=7.4 -pytest-qt>=4.2 -python-dotenv>=1.0 -build>=1.0.3 diff --git a/src/sqliteviewer.egg-info/top_level.txt b/src/sqliteviewer.egg-info/top_level.txt deleted file mode 100644 index ecd5304..0000000 --- a/src/sqliteviewer.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -sqliteviewer diff --git a/src/sqliteviewer/resources/sqliteviewer.desktop b/src/sqliteviewer/resources/sqliteviewer.desktop index a40e758..05cabda 100644 --- a/src/sqliteviewer/resources/sqliteviewer.desktop +++ b/src/sqliteviewer/resources/sqliteviewer.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Name=SQLite Viewer Comment=Browse and query SQLite databases -Exec=sqliteviewer %f +Exec=sqliteview %f Icon=sqliteviewer Terminal=false Type=Application