启动临时pgbouncer实例的装置。

pgbouncer的Python项目详细描述


Copyright (c) 2011, Canonical Ltd

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

python pgbouncer提供了一个python接口来设置和运行pgbouncer 实例。

依赖关系

测试依赖项

除上述内容外,测试还取决于:

用法

创建pgbouncerfixture-一个具有扩展协议的上下文管理器 支持访问日志等。使用数据库定义、用户自定义 凭证,然后当您进入上下文时,它将创建一个瞬态 在临时目录中安装pgbouncer,并在 上下文已打开。

例如:

>>> from pgbouncer import PGBouncerFixture
>>> bouncer = PGBouncerFixture()
>>> bouncer.databases['mydb'] = 'host=hostname dbname=foo'
>>> bouncer.users['user1'] = 'credentials'
>>> with bouncer:
...     # Can now connect to bouncer.host port=bouncer.port user=user1

pgbouncer工作所需的任何设置都将被赋予正常的默认值。

安装

在具有所有可用依赖项的环境中运行setup.py,或者 将工作目录添加到pythonpath。

开发

上游开发发生在https://launchpad.net/python-pgbouncer

要运行测试,请运行:

$ tox

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JavaSpring重定向请求处理程序   SwingJava:拆分字符串并将其放入文本区域的   Java:标记“”上出现语法错误,此标记后面应为表达式   web服务Java RestService从日志文件写入和读取数据   java如何将ArrayList<String>转换为char数组,然后向后打印每个单词?   java SimpleDataFormat解析返回年终日期   加密Java aes解密bytebuffer,包括填充为空字节   java有没有办法从特定的if语句调用变量?   java从更新返回到渲染   spring GRPC Java登录测试   java为什么下面的代码不工作(StringBuffer.toString!=null)   java是一种可行的模式吗?   使用Spring集成测试的JavaOSGi片段   java jCommander为未知和未使用的值引发异常?   在imageView的editText中输入的java图像URL