Skip to main content

quackup 🦆

quackup is a simple and powerful migration tool for DuckDB databases, designed with a clean and familiar CLI interface. Inspired by tools like Alembic and Flyway, quackup helps manage your database schema changes with up/down migrations, versioning, and safe rollbacks.


🎯 Key Features:

  • Versioned Migrations: Automatically generate timestamped migrations with up/down SQL scripts.
  • Up & Down Migrations: Apply and rollback migrations easily using the CLI.
  • Dry-Run Mode: Preview what migrations will run without applying any changes.
  • Migration Status: View which migrations are applied or pending.
  • Supports .env Files: Easily manage database paths using environment variables.

🚀 Installation:

QuackUp is available on PyPI and can be installed using pip:

pip install quackup

📂 Project Structure:

.
├─ migrations/
│    ├─ 2025_02_25_1450-00123abc_create_users_table/
│    │    ├─ up.sql
│    │    └─ down.sql
│    └─ 2025_02_25_1500-00456def_add_email_to_users/
│         ├─ up.sql
│         └─ down.sql
|- quackup.ini
└─ env.ini (optional)

⚡️ Usage:

1. 🆕 Initialize QuackUp:

quackup init

This will automatically create a quackup.ini configuration file and a migrations directory if they do not already exist:

.
├─ quackup.ini       # Configuration file for QuackUp
└─ migrations/       # Directory for storing migration files

The quackup.ini file will contain:

[quackup]
db_env_var = DUCKDB_PATH

You can then set the database path using a .env file or environment variable:

# .env file
DUCKDB_PATH=/path/to/your_database.duckdb

2. 🆕 Create a New Migration:

quackup create "Add email to users table"

This will generate a timestamped migration folder with up.sql and down.sql files:

migrations/
└─ 2025_02_25_1500-00456def_add_email_to_users/
     ├─ up.sql
     └─ down.sql

3. 🚦 Apply All Pending Migrations:

quackup up

Or dry-run to see which migrations would be applied:

quackup up --dry-run

4. 🔄 Rollback Migrations:

quackup down

Or preview the rollback actions:

quackup down --dry-run

5. 📋 Check Migration Status:

quackup status

Example Output:

Migration                                                   Status
----------------------------------------------------------------------
2025_02_25_1450-00123abc_create_users_table                  up
2025_02_25_1500-00456def_add_email_to_users                  down

⚠️ Important Considerations:

  • Make sure your duckdb file path is configured correctly in quackup.
  • Always test migrations in a staging environment before applying them in production.
  • The dry-run mode is a great way to verify what quackup will execute.
  • .env files can be used to automatically set the environment variable needed for quackup to connect to your duckdb database.

🤝 Contributing:

Contributions are welcome! If you find bugs, have feature requests, or want to contribute, please open an issue or submit a pull request.


📄 License:

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for quackup 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quackup 0.0.1
File Size Uploaded Provenance Actions
quackup-0.0.1.tar.gz 6.0 kB Without provenance Details for quackup-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quackup 0.0.1
File Interpreter ABI Platform Actions
quackup-0.0.1-py3-none-any.whl Python 3 none any Details for quackup-0.0.1-py3-none-any.whl

Total release size: 13.4 kB

Release files / quackup-0.0.1.tar.gz

Download URL quackup-0.0.1.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8248ea5fb90717c060e0d920ea67383f2bd3ae9a73d4633f08842c71d7d5d68b
BLAKE2b-256 checksum
How to use checksums
d925b1f17378eb2dc281e5805d5f8478e02c151d95d3daaa63abf93485f4a84a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Release files / quackup-0.0.1-py3-none-any.whl

Download URL quackup-0.0.1-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc3831c8be894d85bcad5e19b9da10a23ca5598156bab4d19ca5be573c02ea2c
BLAKE2b-256 checksum
How to use checksums
7e80b0e02717e87ddfd7b558f4a2ebcbb551ae5c3fd2bbf08099ce52ba887c5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.2

Security for quackup 0.0.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page