sqlseed-cli 0.2.4__py3-none-any.whl

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.
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.5
2
+ Name: sqlseed-cli
3
+ Version: 0.2.4
4
+ Summary: Command-line interface for sqlseed test data generation, preview and configuration replay
5
+ Project-URL: Documentation, https://sunbos.github.io/sqlseed/guide/
6
+ Project-URL: Homepage, https://github.com/sunbos/sqlseed
7
+ Project-URL: Repository, https://github.com/sunbos/sqlseed/tree/main/plugins/sqlseed-cli
8
+ Author-email: SunBo <1443584939@qq.com>
9
+ License-Expression: AGPL-3.0-or-later
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Requires-Python: >=3.10
19
+ Requires-Dist: click>=8.0
20
+ Requires-Dist: rich>=13.0
21
+ Requires-Dist: sqlseed<0.3,>=0.2.4.dev0
22
+ Description-Content-Type: text/markdown
23
+
24
+ # sqlseed-cli
25
+
26
+ Command-line interface for [sqlseed](https://sunbos.github.io/sqlseed/): generate
27
+ SQLite and PostgreSQL test data, preview samples, inspect schema, and save or replay
28
+ configuration. This package provides the `sqlseed` command.
29
+
30
+ ## Installation
31
+
32
+ For the 0.2.4 release, use a Python 3.10+ virtual environment:
33
+
34
+ ```bash
35
+ python -m pip install "sqlseed-cli==0.2.4"
36
+ ```
37
+
38
+ Core 0.2.3 does not provide the URL API required by this CLI.
39
+ For development, install Core and the required local plugins together from the
40
+ repository root:
41
+
42
+ ```bash
43
+ python -m pip install -e . -e ./plugins/sqlseed-cli
44
+ ```
45
+
46
+ For AI commands in a source checkout, install all three local packages together:
47
+
48
+ ```bash
49
+ python -m pip install -e . -e ./plugins/sqlseed-cli -e ./plugins/sqlseed-ai
50
+ ```
51
+
52
+ Installing only `sqlseed` provides the Python API. Install `sqlseed-cli` or the Core
53
+ `cli` extra to get the console command. Faker is included with Core; Mimesis is
54
+ optional. The examples below select the installed Faker provider explicitly.
55
+
56
+ ## Usage
57
+
58
+ Create your tables first, then run:
59
+
60
+ ```bash
61
+ sqlseed fill app.db -t users -n 1000 --provider faker --no-ai
62
+ sqlseed preview app.db -t users -n 5 --provider faker
63
+ sqlseed inspect app.db --table users --show-mapping
64
+ sqlseed init generate.yaml --db app.db
65
+ sqlseed fill app.db -t users -n 100 --provider faker --no-ai --snapshot
66
+ sqlseed replay <cache_dir>/snapshots/YYYY-MM-DD_HHMMSS_ffffff_users.yaml
67
+ ```
68
+
69
+ | Command | Purpose |
70
+ |---|---|
71
+ | `fill` | Generate and write data into existing tables |
72
+ | `preview` | Generate samples without writing them |
73
+ | `inspect` | Show schema and column mapping |
74
+ | `init` | Write a YAML configuration template |
75
+ | `replay` | Run a saved configuration snapshot |
76
+
77
+ For PostgreSQL, install the Core `postgres` extra and use `--url`:
78
+
79
+ ```bash
80
+ python -m pip install "sqlseed[postgres]==0.2.4" "sqlseed-cli==0.2.4"
81
+ sqlseed fill --url "postgresql+psycopg://user:pass@host/db" -t users -n 1000 --provider faker --no-ai
82
+ sqlseed inspect --url "postgresql+psycopg://user:pass@host/db"
83
+ ```
84
+
85
+ For configuration-driven generation, put exactly one of `db_path` or `url` in the YAML.
86
+ Set `provider: faker` in a generated template, or install the optional Mimesis provider
87
+ if the template uses `provider: mimesis`:
88
+
89
+ ```bash
90
+ sqlseed fill --config generate.yaml --no-ai
91
+ ```
92
+
93
+ `--config` cannot be combined with a positional database path or `--url`. Omitted
94
+ `--provider`, `--locale`, and `--batch-size` preserve the YAML values. Explicit options
95
+ override those values, including options equal to the command defaults. Without
96
+ `--config`, the defaults are `mimesis`, `en_US`, and `5000`.
97
+
98
+ If any table reports generation errors, the command prints those errors and exits
99
+ with status 1. `count` reports rows actually committed; a later batch failure can
100
+ leave earlier commits. A snapshot retains a supplied transform script path and replay
101
+ runs that script again; the script itself is not embedded in the snapshot.
102
+
103
+ The optional AI plugin registers `ai-suggest`, `ai-analyze`, and `auto-heal` through
104
+ `sqlseed.cli_commands`. CLI does not require AI for its five base commands.
105
+
106
+ ## Requirements
107
+
108
+ - Python `>=3.10`
109
+ - `sqlseed>=0.2.4.dev0,<0.3`
110
+ - `click>=8.0`
111
+ - `rich>=13.0`
112
+
113
+ See the [user guide](https://sunbos.github.io/sqlseed/guide/),
114
+ [migration guide](https://sunbos.github.io/sqlseed/migration/), and
115
+ [package source](https://github.com/sunbos/sqlseed/tree/main/plugins/sqlseed-cli).
116
+
117
+ License: [AGPL-3.0-or-later](https://github.com/sunbos/sqlseed/blob/main/LICENSE).
118
+ The distribution includes the full LICENSE text.
@@ -0,0 +1,8 @@
1
+ sqlseed_cli/__init__.py,sha256=LWYAx8g50UB9ssH_Ptm1JkGa_8xK8UAIJ92WSslmDlI,2398
2
+ sqlseed_cli/_utils.py,sha256=ZUFQ55sg69ALsxE8w4XNhqfJaSKlO3k-aQwNGePTf6c,684
3
+ sqlseed_cli/main.py,sha256=4k8vPX6cp0uTFp9QhDSMKGf1vWTzYXrR9-p3pn3Y6hA,21705
4
+ sqlseed_cli-0.2.4.dist-info/METADATA,sha256=XQdpc6aMyDbWs_DzI2jZkdIUWgQtbG1pe503j7eWQe4,4571
5
+ sqlseed_cli-0.2.4.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
6
+ sqlseed_cli-0.2.4.dist-info/entry_points.txt,sha256=ahwSeWp_DYjJ2kzD184uaYmxyB1kam-Vh3n-ef8G4sk,45
7
+ sqlseed_cli-0.2.4.dist-info/licenses/LICENSE,sha256=YBF91vYz3wZ5LfDR6oUtQ-r3qy0pSd7Ld-SgFNYRzkE,35257
8
+ sqlseed_cli-0.2.4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.32.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sqlseed = sqlseed_cli:main