This release is a pre-release and may not be stable for production use.
qseed
Generate test data from your MSSQL stored procedures — automatically.
qseed connects to your MSSQL database, fetches all DDL needed by a stored procedure or query, calls the datagen API, and writes INSERT statements to stdout, a file, or your clipboard.
Quick Start
# Point to your datagen-core API
qseed config set-api https://datagen.aldimhr.dev
# Add your database (password stored in OS keyring)
qseed config add default
# Generate 10 rows for a stored procedure
qseed --procedure GetCustomerOrders --rows 10
# Pipe directly to sqlcmd
qseed --procedure GetCustomerOrders --rows 50 | sqlcmd -S myserver -d mydb
Or skip the config file and pass everything on the command line:
qseed \
--server mydb.company.com --database SalesDB --user sa --password secret \
--procedure GetCustomerOrders --rows 10 -o test_data.sql
Installation
From PyPI
pip install qseed
From Repository
git clone https://github.com/aldimhr/qseed.git
cd qseed
pip install .
Ubuntu / Raspberry Pi
pymssql requires FreeTDS:
sudo apt-get install -y python3-dev freetds-dev freetds-bin libssl-dev
pip install qseed
macOS
brew install freetds
pip install qseed
Commands
run (default)
Generate INSERT statements. The run subcommand is optional — if you pass --procedure, --sql, or --sql-file, it's implied automatically.
# From a stored procedure
qseed --procedure GetCustomerOrders --rows 10
# From raw SQL
qseed --sql "SELECT * FROM Orders WHERE Status = 'ACTIVE'" --rows 5
# From a .sql file
qseed --sql-file query.sql --rows 20
# Explicit run (same as above)
qseed run --procedure GetCustomerOrders --rows 10
Connection options
| Flag | Description |
|---|---|
--server HOST |
MSSQL server hostname or IP |
--port PORT |
Port (default: 1433) |
--database DB |
Database name |
--user USER |
SQL Server login |
--password PASS |
Password |
--password-env VAR |
Read password from environment variable |
--profile NAME |
Use a saved connection profile |
Generation options
| Flag | Description |
|---|---|
-r, --rows N |
Target row count (default: 10) |
-p, --param @N=V |
Parameter binding, repeatable |
--schema SCHEMA |
Schema for object lookup (default: dbo) |
Sub-procedure handling
| Flag | Description |
|---|---|
--recursive |
Discover tables from sub-procedures called via EXEC |
--max-depth N |
Max recursion depth (default: 5) |
--no-sub-proc-warning |
Suppress the sub-procedure warning |
Output options
| Flag | Description |
|---|---|
-o, --output PATH |
Write to file (default: stdout) |
--copy |
Copy to clipboard |
--open |
Open in $DATAGEN_EDITOR or $EDITOR |
Debug options
| Flag | Description |
|---|---|
--dry-run |
Fetch DDL and print it without calling the API |
--show-ddl |
Print fetched DDL alongside the output |
--timeout N |
DB connection timeout in seconds (default: 30) |
--api-timeout N |
API call timeout in seconds (default: 120) |
list
Browse stored procedures in the database.
qseed list
qseed list --schema sales
qseed list --search Customer
qseed list --json
config
Manage connection profiles.
qseed config add production # Interactive prompts
qseed config list # All profiles (passwords masked)
qseed config show default # Profile details
qseed config test production # Test DB + API reachability
qseed config remove old-profile # Remove a profile
qseed config set-default production # Set the default profile
qseed config set-api https://... # Set the API URL
version
qseed version
Configuration
Config File
~/.qseed/config.json:
{
"api_url": "https://datagen.aldimhr.dev",
"api_timeout": 120,
"default_profile": "default",
"profiles": {
"default": {
"server": "localhost",
"port": 1433,
"database": "MyDatabase",
"user": "sa",
"password_keyring": true,
"schema": "dbo"
}
}
}
Password Storage
Passwords are stored in your OS keyring (keyring package):
- macOS: Keychain
- Linux: libsecret / GNOME Keyring / KWallet
- Windows: Windows Credential Manager
If the keyring is unavailable, the CLI prompts for the password on each run.
Environment Variables
All settings can be set via environment variables (no config file needed):
export DATAGEN_API_URL=https://datagen.aldimhr.dev
export DATAGEN_SERVER=mydb.company.com
export DATAGEN_DATABASE=SalesDB
export DATAGEN_USER=datagen_readonly
export DATAGEN_PASSWORD=$DB_PASSWORD
Env vars take priority over the config file. CLI flags take priority over env vars.
CI/CD Usage
DATAGEN_API_URL=https://datagen.aldimhr.dev \
DATAGEN_SERVER=mydb.company.com \
DATAGEN_DATABASE=SalesDB \
DATAGEN_USER=datagen_readonly \
DATAGEN_PASSWORD=${{ secrets.DB_PASSWORD }} \
qseed --procedure GetCustomerOrders --rows 50 -o test_data.sql
How It Works
qseed datagen-core (API)
───────────── ──────────────────
1. Connect to your MSSQL
2. Fetch SP DDL + table DDL
+ view DDL
3. POST /generate ──────────► 4. Parse constraints
5. Generate INSERTs
6. Write output ◄──────────── (plain SQL text)
(stdout / file / clipboard)
Credentials never leave your machine. Only DDL text is sent to the API.
Dependencies
pymssql >=2.3— MSSQL connectionrequests >=2.31— HTTP calls to datagen-corekeyring >=25.0— OS password storagepyperclip >=1.8— Clipboard output
Development
git clone https://github.com/aldimhr/qseed.git
cd qseed
pip install -e ".[dev]"
python -m datagen_cli --help
Metadata
Release files for qseed 0.3.0a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qseed-0.3.0a0.tar.gz | 27.4 kB | Without provenance | Details for qseed-0.3.0a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qseed-0.3.0a0-py3-none-any.whl | Python 3 | none | any | Details for qseed-0.3.0a0-py3-none-any.whl |
Total release size: 55.3 kB
Release files / qseed-0.3.0a0.tar.gz
| Download URL | qseed-0.3.0a0.tar.gz |
|---|---|
| Size | 27.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b69fc0538aed64d571ba64026cdb4e21447f17665cc002abebdb424f955eff5
|
|
BLAKE2b-256 checksum How to use checksums |
82ffe3b1f0d1f5cdbf7382fc9ddad23d8f820604ce685249a527279a2e1dfcdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / qseed-0.3.0a0-py3-none-any.whl
| Download URL | qseed-0.3.0a0-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
969248b8d7eede18b24556413390052fa7271e1d26f380b769e6ff5a01a3f922
|
|
BLAKE2b-256 checksum How to use checksums |
53dc250d0dd85c8f88ed28bbc7b9e76b496d1dd4280a57674d40224ba02db32c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for qseed 0.3.0a0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.