erdb 1.1.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb43b27d324884db21ead2653426adbeba09a183733ee33bb4675b601d49d40c
4
- data.tar.gz: 32e01870dabcc268910d912afa9d4b5341afd5a3f3b7afed38fc1aea3c1b6bb9
3
+ metadata.gz: fd50d69ff105b8b36454c0bf0ea0e6856c542a918e76624cdc6b824b8a259fc5
4
+ data.tar.gz: cc008ed9f2e0a730954725fa344a4f34948552483e41640c010a6bac29a76e41
5
5
  SHA512:
6
- metadata.gz: a220a81b743ff5c8ccc3bdec373d788ef6ef64fac8f8db2eebfb0ab95b96d13be351e74340f91534165e9a1d1fa3a8f9b5d5730f34073e8353ec929fb7ab13cb
7
- data.tar.gz: a445779b1ac54a74c5acc673f5bf3905868a880200843e413df643091da05ac8eb407ae2faaef421b131dce349eaeb5c5e969cb11e1aedd68ca79932c60de114
6
+ metadata.gz: 2ac6553030f6d2c5d528626c0d366da1e714ddcf28731dd124eb1db2ea7a48595667788549708bf5f8f8f9ed102af49929808c48ae5842badf16de333e8e5522
7
+ data.tar.gz: cccb9ac0141ab61b74e739e67ac51d1994f0c25f3f7641f18fb7d074f5169095caf646703b751b7244448cd909669d12d201b8073901a48bfc56fbfef8150143
data/CHANGES.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.1.2
2
+
3
+ - Remove metadata table and schema_migrations table from diagram.
4
+
5
+ ### 1.1.1
6
+
7
+ - Show `No Tables` error message when there is no tables.
8
+
1
9
  ### 1.1.0
2
10
 
3
11
  - Use `Thor` to make cli.
data/README.md CHANGED
@@ -7,10 +7,6 @@ ERDB is just a wrapper to automate the process of generating ERD using -
7
7
  - [Azimutt(Open Source)](https://azimutt.app)
8
8
  - [DBDiagram](https://dbdiagram.io)
9
9
 
10
- > Currently there is no support for `one-to-one` relationship. If you want to use it you have to manually edit the generated ERD.
11
-
12
- <!-- graphviz coming soon -->
13
-
14
10
  ## Demo
15
11
 
16
12
  ![erdb](./images/erdb.gif)
@@ -28,14 +24,12 @@ Use the package manager [gem](https://rubygems.org/) to install ERDB.
28
24
  gem install erdb
29
25
  ```
30
26
 
31
- > Important note for Linux users: The clipboard requires the _xsel_ or the _xclip_ command-line program. On debian and ubuntu, _xsel_ can be installed with: `sudo apt-get install xsel`
32
- > Visit [clipboard](https://github.com/janlelis/clipboard) for more details.
27
+ > Important note for Linux users: You need to install the _xsel_ or the _xclip_ command-line program. On debian and ubuntu, _xsel_ can be installed with: `sudo apt-get install xsel`
28
+ > Visit [clipboard](https://github.com/janlelis/clipboard) for more details about clipboard.
33
29
 
34
30
  #### Adapters
35
31
 
36
- For `mysql2` and `postgresql` database, you have to install the required gem.
37
- I didn't include them in the gemspec because I don't want to install them if you don't need them.
38
- Because it depends on native extensions, you'll need a compiler and the development headers for your Ruby and database.
32
+ For `mysql2` and `postgresql` database, you have to install the required gems.
39
33
 
40
34
  ```bash
41
35
  gem install mysql2
@@ -50,23 +44,20 @@ After install ERDB, you can use `erdb` command to generate ER Diagram.
50
44
  erdb
51
45
  ```
52
46
 
53
- ## Why I created this gem?
47
+ It use chrome browser by default to genereate ERD.
48
+ You can use other browser by passing `--browser` option.
54
49
 
55
- I know there are many tools available for generating ERD,
56
- but I wanted to create a tool that is easy to use and can be used with any database.
57
- `Azimutt` also support converting schema to ERD, but it's only working well with remote databases.
58
- If I want to generate local database using `Azimutt`, I have to setup `Azimutt` locally that is alot of step -\_-
50
+ > See more options by running `erdb --help`
59
51
 
60
- ## Roadmap
52
+ ## Why I created this gem?
61
53
 
62
- - [x] Support `sqlite3`, `mysql2` and `postgresql` database.
63
- - [x] Generate ERD using Azimutt
64
- - [x] Generate ERD using DBDiagram
65
- - [ ] Support `MongoDB` database.
54
+ I know there are many tools available for generating ERD,
55
+ But I wanted to create a tool that is easy to use and can be used with any database.
56
+ And I don't want to repeat the same steps again and again for generating ERD. -_-
66
57
 
67
58
  ## Contributing
68
59
 
69
- Pull requests are welcome. Feel free to open an issue first to discuss what you would like to change.
60
+ Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
70
61
 
71
62
  ## License
72
63
 
@@ -37,7 +37,14 @@ module ERDB
37
37
  #
38
38
  def to_erdb
39
39
  puts "\nAnalyzing database..."
40
- @connection.tables.map do |table|
40
+
41
+ raise "No tables found in database." if @connection.tables.empty?
42
+
43
+ tables = @connection.tables.reject do |table|
44
+ %w[schema_migrations ar_internal_metadata].include?(table)
45
+ end
46
+
47
+ tables.map do |table|
41
48
  columns = @connection.columns(table).map { |column| { name: column.name, type: column.type || "unknown" } }
42
49
  relations = @connection.foreign_keys(table).map do |fk|
43
50
  {
data/lib/erdb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ERDB
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.1.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wai Yan Phyo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-03 00:00:00.000000000 Z
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord