A cli tool for tortoise-orm, build on top of click and ptpython.
Project description
tortoise-cli
A cli tool for tortoise-orm, build on top of click and ptpython.
Installation
You can just install from pypi.
pip install tortoise-cli
Quick Start
> tortoise-cli -h 23:59:38
Usage: tortoise-cli [OPTIONS] COMMAND [ARGS]...
Options:
-V, --version Show the version and exit.
-c, --config TEXT TortoiseORM config dictionary path, like
settings.TORTOISE_ORM
-h, --help Show this message and exit.
Commands:
shell Start an interactive shell.
Usage
First, you need make a TortoiseORM config object, assuming that in settings.py
.
TORTOISE_ORM = {
"connections": {
"default": "sqlite://:memory:",
},
"apps": {
"models": {"models": ["examples.models"], "default_connection": "default"},
},
}
Interactive shell
Then you can start an interactive shell for TortoiseORM.
tortoise-cli -c settings.TORTOISE_ORM shell
Or you can set config by set environment variable.
export TORTOISE_ORM=settings.TORTOISE_ORM
Then just run:
tortoise-cli shell
License
This project is licensed under the Apache-2.0 License.
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
tortoise-cli-0.1.1.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for tortoise_cli-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5bd81f2dc12b9402a0249c72da956a1e621d161dc799c2f13cf66caab3533bd |
|
MD5 | c8a9fdb185499f8fb187ad9921402b06 |
|
BLAKE2b-256 | ad81e1a1a9e1505411aeb2375b9963fa9c3ca58a1792b1cdc1a70b0d030a8584 |