Skip to main content

A batabase manager plugin for nonebot2,provide capability of connection to all kinds of databases

Project description

nonebot_plugin_navicat

pypi implementation wheel python license

功能

  • 对外暴露出数据库连接 支持mysql mongodb redis

开始使用

必须使用 pip

  • 通过 pip 从 PyPI 安装
pip install nonebot-plugin-navicat
  • 我全都要
pip install nonebot-plugin-navicat[all]
  • 要使用mysql
pip install nonebot-plugin-navicat[mysql]
  • 要使用mongodb
pip install nonebot-plugin-navicat[mongodb]
  • 要使用redis
pip install nonebot-plugin-navicat[redis]
  • 在 nonebot2 项目中设置 load_plugin()
nonebot.load_plugin('nonebot_plugin_navicat')
  • 参照下文在 nonebot2 项目的环境文件 .env.* 中添加配置项

配置项

配置数据库连接

# mysql 如果有MYSQL_HOST则表示要进行mysql连接
MYSQL_HOST
MYSQL_PORT
MYSQL_USER
MYSQL_PASSWORD

# mongodb 如果有MONGODB_HOST则表示要进行mongodb连接
MONGODB_HOST
MONGODB_PORT
MONGODB_USER
MONGODB_PASSWORD

# redis 如果有REDIS_HOST则表示要进行redis连接
REDIS_HOST
REDIS_PORT
REDIS_PASSWORD
REDIS_DB

# 以后会加入更多数据库支持

导出给其他插件

export = nonebot.require("nonebot_plugin_navicat")
export.mysql_pool # mysql的
export.mongodb_client # mongodb的
export.redis_client # redis的

特别感谢

优化建议

  • 来个postgresql支持?

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-navicat-0.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_navicat-0.1.2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file nonebot-plugin-navicat-0.1.2.tar.gz.

File metadata

  • Download URL: nonebot-plugin-navicat-0.1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for nonebot-plugin-navicat-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9fe3c2b6545ac83b116514afa8f37766c69873459d38e79f58d259c462da3eea
MD5 00eb0df8f637fe6a8fb6cd2ddf483088
BLAKE2b-256 35871dccc3b6f7a0aae8eceac7c15eb42c26362c7aaf4d703324825c8c360a75

See more details on using hashes here.

File details

Details for the file nonebot_plugin_navicat-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: nonebot_plugin_navicat-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20201009 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for nonebot_plugin_navicat-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7270aae32807d6c1fe9dbeebf0d7ccce4d8a1fc78e21c7f04c2cf0757bb92a46
MD5 860ce94493a4d7c97c3f9afacdd949dc
BLAKE2b-256 e2a5063f44bda6e4aac9041acadc4d215c9091fe0642841a6884dd383d3b7d2b

See more details on using hashes here.

Supported by

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