Skip to main content

dbine

Auxiliary tools related to databases

Concept

PDF output from database table definitions

Database table definitions(MySQL)

DROP DATABASE IF EXISTS db;
CREATE DATABASE db;

DROP USER IF EXISTS _user_;
CREATE USER _user_ IDENTIFIED BY 'pass';

GRANT ALL ON db.* TO _user_;

DROP TABLE IF EXISTS no_comments;
CREATE TABLE no_comments (
  id INT PRIMARY KEY,
  name VARCHAR(10)
) COMMENT 'コメントなしテーブル';

DROP TABLE IF EXISTS with_comments;
CREATE TABLE with_comments (
  id INT PRIMARY KEY COMMENT 'ID',
  name VARCHAR(10) COMMENT '名前'
) COMMENT 'コメントつきテーブル';

DROP TABLE IF EXISTS relations;
CREATE TABLE relations (
  id INT PRIMARY KEY COMMENT 'ID',
  no_comment_id INT COMMENT 'コメントなしテーブルのID',
  with_comment_id INT COMMENT 'コメントつきテーブルのID'
);

PDF(PNG)

What is possible

  1. Log in to the database and get table definition information
  2. Output table definition information as an ER diagram-like image in PDF
  3. Convert PDF to image

Reason for development

  • I want to output the relationships between database table definitions as a PDF or image so that I can understand them at a glance

Supported database types

  • PostgreSQL
  • MySQL
  • SQLite

Versions

Version Summary
0.1.6 Added SQLite to supported databases
0.1.4 Improved ease of use
0.1.3 Release dbine

Installation

dbine

pip install dbine

Graphviz

Required for PDF output

Poppler

Required for PDF image conversion

CLI

pdf.write

Write database table definition to PDF

1. Prepare database connection config file(database.yaml)

[database.yaml]

Type: MySQL
DatabaseName: db
UserName: _user_
Password: pass
Host: localhost
Port: 0

2. PDF write by CLI execution

pdf.write # <yaml file path> <pdf file path>

dbine pdf.write database.yaml database.pdf

database.pdf is done.

pdf.convert

Convert PDF to image

1. Image(PNG) conversion by CLI execution

pdf.convert # <pdf file path> <image file path>

dbine pdf.convert database.pdf database.png

database.png is done.

Release files for dbine 0.1.6

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

Source distribution (sdist)

Source distribution for dbine 0.1.6
File Size Uploaded
dbine-0.1.6.tar.gz 6.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dbine 0.1.6
File Interpreter ABI Platform
dbine-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / dbine-0.1.6.tar.gz

Download URL dbine-0.1.6.tar.gz
Size 6.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1ad83baf11920a5f62d4eab200243fe537f2675cb7c7d503547ce4dd35fc349f
BLAKE2b-256 checksum
How to use checksums
ee48e915574d0e3faaf8eb981208a45f6281e31a55cb38b6089a23076eaa38ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.0

Release files / dbine-0.1.6-py3-none-any.whl

Download URL dbine-0.1.6-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca34ed624b8216ba31ac7041d0f222b9d8db266763991f411178dfc9dae6762c
BLAKE2b-256 checksum
How to use checksums
53f1ef9dae97acf43a6df3e916b3ee30e0dea877bb439614d47088370a49cbde
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.13.0

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

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