Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A cli tool for tortoise-orm, build on top of click and ptpython

License

NotificationsYou must be signed in to change notification settings

tortoise/tortoise-cli

Repository files navigation

imageimageimage

A cli tool for tortoise-orm, build on top of asyncclick and ptpython.

Installation

You can just install from pypi.

pip install tortoise-cli

Quick Start

> tortoise-cli -h                                                                                                                                                                 23:59:38Usage: tortoise-cli [OPTIONS] COMMAND [ARGS]...Options:  -V, --version      Show the version and exit.  -c, --config TEXT  TortoiseORM config dictionary path, like                     settings.TORTOISE_ORM  --generate-schemas / --no-generate-schemas                     Whether generate schemas after TortoiseORM                     inited  -h, --help         Show this message and exit.Commands:  shell  Start an interactive shell.

Usage

First, you need make a TortoiseORM config object, assuming that insettings.py.

TORTOISE_ORM= {"connections": {"default":"sqlite://:memory:",    },"apps": {"models": {"models": ["examples.models"],"default_connection":"default"},    },}

Interactive shell

image

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

Or you can set it inpyproject.toml.

[tool.aerich]tortoise_orm ="my_module.TORTOISE_ORM"

Then just run:

tortoise-cli shell

License

This project is licensed under theApache-2.0 License.

About

A cli tool for tortoise-orm, build on top of click and ptpython

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp