Skip to main content

一个通用数据库连接插件

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot-plugin-tortoise-orm-0.0.1a3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nonebot-plugin-tortoise-orm-0.0.1a3.tar.gz.

File metadata

File hashes

Hashes for nonebot-plugin-tortoise-orm-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 79c0cf30e7e5291089d034d561ad53744963de629b49737332467f3eaefa10e3
MD5 4f9c4bc09fdaf6545a74cba1849e1c68
BLAKE2b-256 a279e722f8a455ff7eb3bc307501ce17910b6821f1b489d7a5fadce39912af5c

See more details on using hashes here.

Provenance

File details

Details for the file nonebot_plugin_tortoise_orm-0.0.1a3-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_tortoise_orm-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 9b03f09d0dc24cb4f018467c98bcd0d1c10978e48e44036fc2836a545734d0a7
MD5 7df13bd759a9ee9c69d8f0d72ff9a597
BLAKE2b-256 8df4984ab4f1458d72a0978cb34b36aa47f4a951bee7c8fedd60f1fbc97834f6

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page