Add your description here
Project description
vivadb-py
A python wrapper around vivadb.
Installation
Install through pip (or your favorite dependency manager):
pip install vivadb-py
Commands
The package comes bundled with the vivadb executable and has all its subcommands.
config - Database Configuration
Configure your PostgreSQL connection settings and save them to environment files.
vivadb config [OPTIONS]
Options:
--host- PostgreSQL host (default: localhost)--port- PostgreSQL port (default: 5432)--user- PostgreSQL username--password- Password (not recommended for production)--password-stdin- Input password securely from stdin--dbname- Database name--prod- Write to production environment file-h, --help- Show help for this command
Examples:
# Configure development database with secure password input
vivadb config --host=localhost --port=5432 --user=myuser --dbname=postgres --password-stdin
# Configure production database
vivadb config --host=prod-server --use= prod_user --dbname=production_db --prod --password-stdin
exec - Execute SQL Queries
Execute SQL queries with production awareness and optional safety checks.
vivadb exec [OPTIONS]
Options:
-q, --query- SQL query to execute-s, --safe- Execute only safe queries-p, --prod- Run in production environment-h, --help- Show help for this command
Examples:
# Execute a safe query in development
vivadb exec --query="SELECT * FROM users LIMIT 10;" --safe
# Execute query in production (use with caution)
vivadb exec --query="UPDATE users SET status = 'active' WHERE created_at > '2024-01-01';" --prod
new - Create New Project
Create a new project with database integration and optional Docker setup.
vivadb new [OPTIONS]
Options:
--host- PostgreSQL host--port- PostgreSQL port--user- PostgreSQL username--password- Password (not recommended)--password-stdin- Input password securely from stdin--dbname- Database name--prod- Configure for production--docker- Create Docker Compose configuration-h, --help- Show help for this command
Examples:
# Create new project with Docker setup
vivadb new --project-name=hello_world --docker --host=localhost --port=5432 --user=myuser --dbname=postgres --password-stdin
migrate - Database Migrations
Update your database schema in a production-aware manner.
vivadb migrate [OPTIONS]
Options:
--prod- Run migration in production environment-h, --help- Show help for this command
Examples:
# Run migrations in development
vivadb migrate
# Run migrations in production
vivadb migrate --prod
Environment Files
vivadb manages separate environment files for development and production:
- Development:
.vivadb/.env.local - Production:
.vivadb/.env
This separation helps prevent accidental operations on production databases during development.
Security Best Practices
-
Use
--password-stdin: Always use the--password-stdinflag instead of--passwordto avoid exposing credentials in your shell history. -
Production flag: Always use the
--prodflag when working with production databases to ensure proper environment separation. -
Safe queries: Use the
--safeand/or--prodflag with theexeccommand when possible to enable additional safety checks.
Project Structure
When using vivadb new, the tool creates a project structure optimized for database-driven applications, including:
- Environment configuration files
- Optional Docker Compose setup for local PostgreSQL
- Project scaffolding with database integration
Here is how a project would look like:
.
├── .gitignore
├── .vivadb
│ ├── .env.local
│ └── compose.yaml
├── README.md
└── schema.v.sql
Contributing
Contributions are more than welcome! Find the contribution guidelines here
License
This project is distributed under an MIT License
Support
For issues and questions, please create an issue in the repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vivadb_py-0.1.0a0.tar.gz.
File metadata
- Download URL: vivadb_py-0.1.0a0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6b6cc1710b2d9aceb175e18956565ec95f3cf3d28a84b24a1f97ad415797856
|
|
| MD5 |
8b158d01df907523fd1e6facf6d2898c
|
|
| BLAKE2b-256 |
d08a995b6a05dd742afcb2fab368dd44ae2f231df761f350d8564ae79c2b4465
|
File details
Details for the file vivadb_py-0.1.0a0-py3-none-any.whl.
File metadata
- Download URL: vivadb_py-0.1.0a0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a6bbc480f04dc0d6f9b24595eabb77cc106692cf483d19bc36e57fe480c1ea1
|
|
| MD5 |
5daa0aaeb1778d6fb812e9fd24beb379
|
|
| BLAKE2b-256 |
82189a1778748d17fe51bcf968ade407820affc3b1f8bf8b8245008e16369e51
|