VeighNa框架的QuestDB数据库接口
说明
对接 QuestDB 的高性能时序数据库接口实现。
主要特性:
- 通过 QuestDB ILP/HTTP 高速写入K线和Tick数据。
- 通过 PGWire 执行建表、查询、汇总和逻辑删除。
- 使用 QuestDB WAL 表和
DEDUP UPSERT KEYS支持重复数据覆盖。 - 使用
deleted字段进行逻辑删除,查询和汇总时自动过滤已删除数据。
安装
pip install vnpy_questdb
QuestDB 端口说明
当前实现会同时使用 QuestDB 的两个服务端口:
database.port:PGWire SQL端口,默认8812。代码使用psycopg连接该端口,用于创建表、读取数据、查询汇总、执行逻辑删除,以及检查 WAL 事务是否已经应用。database.http_port:HTTP端口,默认9000。代码使用questdb.ingress.Sender通过 ILP/HTTP 写入K线和Tick数据。
这两个端口的职责不同,不能互相替代。8812 面向 PostgreSQL Wire Protocol 查询;9000 面向 QuestDB HTTP服务,其中包含 ILP/HTTP 写入入口和 Web Console。如果使用 Docker、远程服务器或防火墙,需要同时开放这两个端口。
示例 Docker 端口映射:
docker run --rm -p 8812:8812 -p 9000:9000 questdb/questdb
当前版本使用 ILP/HTTP 写入,不使用 QuestDB 的 ILP/TCP 9009 端口。
VeighNa 配置
在 VeighNa 配置文件中选择 QuestDB 数据库,并配置连接参数:
{
"database.name": "questdb",
"database.host": "localhost",
"database.port": 8812,
"database.user": "admin",
"database.password": "quest",
"database.database": "qdb",
"database.http_port": 9000
}
参数说明:
database.name:数据库适配器名称,使用本插件时配置为questdb。database.host:QuestDB 服务地址,PGWire 和 HTTP ILP 都会连接该地址。database.port:PGWire SQL端口,用于查询和管理操作。database.user:PGWire 用户名,QuestDB 默认值为admin。database.password:PGWire 密码,QuestDB 默认值为quest。database.database:PGWire 数据库名,QuestDB 默认值为qdb。database.http_port:QuestDB HTTP端口,用于 ILP/HTTP 数据写入。
如果 QuestDB 部署在远程主机,请确认 database.host 可以从运行 VeighNa 的机器访问,并确认 database.port 与 database.http_port 均已开放。
Metadata
Release files for vnpy_questdb 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vnpy_questdb-1.0.0.tar.gz | 10.5 kB | Without provenance | Details for vnpy_questdb-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vnpy_questdb-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for vnpy_questdb-1.0.0-py3-none-any.whl |
Total release size: 19.3 kB
Release files / vnpy_questdb-1.0.0.tar.gz
| Download URL | vnpy_questdb-1.0.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
096f89390addfe832600d3acf2c0a0333a3fbfe11ba7b60f2d312de0685f6f5b
|
|
BLAKE2b-256 checksum How to use checksums |
83081199804730e600677a817fc83f3107ce23c41ec7ead9c05e37edcc206162
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.3
|
Release files / vnpy_questdb-1.0.0-py3-none-any.whl
| Download URL | vnpy_questdb-1.0.0-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1afc0c1b1a6ec1d5c1df01f89fc27c58f25e5dc3c09a43a8c3dff433e21aaaef
|
|
BLAKE2b-256 checksum How to use checksums |
14be68bdc73d9c04622076ba04c8b79f13e694ce74cc8a1b2cdf09ec39508599
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.3
|
Security for vnpy_questdb 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.