Skip to main content

db-to-db

PostgreSQL 表同步工具 — 浏览器操作,纯 Python,一条命令即可部署为 Windows 系统服务。


快速开始

pip install db-to-db

# 方式 A:手动启动(调试用)
db-to-db run --open

# 方式 B:安装为系统服务(开机自启,无终端窗口)
db-to-db service install --port 5001

浏览器打开 http://127.0.0.1:5001


功能

功能 说明
连接管理 保存多个数据库连接,支持直连 / HTTP 代理
表同步 选择源和目标库,勾选表,一键 TRUNCATE + INSERT
同步历史 查看过往同步记录,含状态、行数、错误信息
热重载 修改代码无需重启服务,uvicorn --reload 自动检测
开机自启 通过 WinSW 注册为 Windows 系统服务

CLI 命令

# 启动
db-to-db run                        # 启动 Web 界面
db-to-db run --open                 # 启动并打开浏览器

# 服务管理(Windows)
db-to-db service install            # 安装服务(开机自启)
db-to-db service uninstall          # 卸载
db-to-db service start|stop|restart # 服务控制
db-to-db service status             # 查看状态
db-to-db service info               # 运维指南

# 版本
db-to-db version

自定义代码 + 热重载

git clone <仓库地址>
cd db-to-db
pip install -e .        # 可编辑安装

修改源码 → 保存即生效,uvicorn 自动热重启。


技术栈

  • FastHTML — AI 时代的 Python Web 框架
  • HTMX — 零手写 JS 的交互
  • DuckDB — 嵌入式本地配置存储
  • psycopg2 — PostgreSQL 连接驱动
  • uvicorn — Python ASGI 服务器(--reload 热重载)
  • WinSW — Windows 服务封装
  • Click — CLI 命令行框架
  • httpx — HTTP 客户端(代理模式)

数据存储

默认位置:~/.db-to-db/config.duckdb 环境变量 DB_TO_DB_DIR 可自定义。


许可证

MIT © tieshou(望月)

Metadata

Release files for db-to-db 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for db-to-db 0.2.1
File Size Uploaded Provenance Actions
db_to_db-0.2.1.tar.gz 41.8 kB Without provenance Details for db_to_db-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for db-to-db 0.2.1
File Interpreter ABI Platform Actions
db_to_db-0.2.1-py3-none-any.whl Python 3 none any Details for db_to_db-0.2.1-py3-none-any.whl

Total release size: 79.9 kB

Release files / db_to_db-0.2.1.tar.gz

Download URL db_to_db-0.2.1.tar.gz
Size 41.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c6d6afa8a2575ed6d4f6ce1cc42a548f445464498ee9980ba7c03edeb9d179ad
BLAKE2b-256 checksum
How to use checksums
50a04c982e9e5e4b150356ccab857cf06ebde2c49150a24bf5ec5110cac09df6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / db_to_db-0.2.1-py3-none-any.whl

Download URL db_to_db-0.2.1-py3-none-any.whl
Size 38.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f794aec9bc2427ecc2b376db44d5a86c07d98d24c9e4250ca4eb62aac0d306e4
BLAKE2b-256 checksum
How to use checksums
08b9bfefcf0e17becc0a6a7a6810aaa588975918a037815d05fd46a57a5a51b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for db-to-db 0.2.1

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page