一个通用数据库连接插件
Project description
通用 ORM 数据库连接插件
施工中。。。
- 参考 example_bot 来创建一个 聊天记录 插件吧~!
.env
设置
参考配置:
# db_url=postgres://postgres@localhost:5432/postgres
db_url=sqlite://db.sqlite3
db_generate_schemas=false
db_url
使用 sqlite
直接使用相对路径来建立
db_url=sqlite://db.sqlite3
如果时指定路径,则应该是
db_url=sqlite:///data/db.sqlite
使用绝对路径 注意有三个 /
使用 PostgreSQL
db_url=postgres://postgres:pass@db.host:5432/somedb
- 说明:
postgres://
表示协议 postgres:pass@
表示登入账号和密码 如果没有密码则用postgres@
db.host:5432
表示数据库的地址 和 端口 如果是本机 则为localhost:5432
/somedb
表示数据库名
使用 MySQL/MariaDB
db_url=mysql://myuser:mypass:pass@db.host:3306/somedb
跟上面的差不多
数据库类型
- postgres
- sqlite
- MySQL/MariaDB
其他待补充
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
Close
Hashes for nonebot-plugin-tortoise-orm-0.0.1a3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79c0cf30e7e5291089d034d561ad53744963de629b49737332467f3eaefa10e3 |
|
MD5 | 4f9c4bc09fdaf6545a74cba1849e1c68 |
|
BLAKE2b-256 | a279e722f8a455ff7eb3bc307501ce17910b6821f1b489d7a5fadce39912af5c |
Close
Hashes for nonebot_plugin_tortoise_orm-0.0.1a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b03f09d0dc24cb4f018467c98bcd0d1c10978e48e44036fc2836a545734d0a7 |
|
MD5 | 7df13bd759a9ee9c69d8f0d72ff9a597 |
|
BLAKE2b-256 | 8df4984ab4f1458d72a0978cb34b36aa47f4a951bee7c8fedd60f1fbc97834f6 |