Skip to main content

Auxiliary tools related to databases

Project description

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.

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

dbine-0.1.6.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

dbine-0.1.6-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file dbine-0.1.6.tar.gz.

File metadata

  • Download URL: dbine-0.1.6.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for dbine-0.1.6.tar.gz
Algorithm Hash digest
SHA256 1ad83baf11920a5f62d4eab200243fe537f2675cb7c7d503547ce4dd35fc349f
MD5 6414a85144dc2b1b974dc8c2ea3e2be1
BLAKE2b-256 ee48e915574d0e3faaf8eb981208a45f6281e31a55cb38b6089a23076eaa38ae

See more details on using hashes here.

File details

Details for the file dbine-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: dbine-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for dbine-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ca34ed624b8216ba31ac7041d0f222b9d8db266763991f411178dfc9dae6762c
MD5 3fec917516a94447e8c1ba6c566e4cf5
BLAKE2b-256 53f1ef9dae97acf43a6df3e916b3ee30e0dea877bb439614d47088370a49cbde

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