erdb 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +4 -0
- data/README.md +11 -13
- data/lib/erdb/adapters/sql.rb +3 -0
- data/lib/erdb/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c78c60da7522f9f14d1fb6a56e3f2531d8b24311aa3179649032415fb5bea5e3
|
4
|
+
data.tar.gz: 4b7efdc217e9fdaa8d2b6fd7e41dfa5f8e4acae0aefc705d20bd8d61889f1469
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4515effe4b61586d0cb94e67d65e51b1ca350aeb74f41c7c98e69993f146a82095256421403272234f808b5b00e90f9c2ed1a413d3f073a8a8e0bcb463dd389
|
7
|
+
data.tar.gz: f8b12f1fa9c0446fe3a7029e7f3a2ca424ba7034cab3aaaea30e46dcb1750abe0d98856ba79d6baec55cacd9a58783fc56c85a96c7e90f33d165840f8e72e257
|
data/CHANGES.md
CHANGED
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:
|
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
|
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,12 +44,16 @@ After install ERDB, you can use `erdb` command to generate ER Diagram.
|
|
50
44
|
erdb
|
51
45
|
```
|
52
46
|
|
47
|
+
It use chrome browser by default to genereate ERD.
|
48
|
+
You can use other browser by passing `--browser` option.
|
49
|
+
|
50
|
+
> See more options by running `erdb --help`
|
51
|
+
|
53
52
|
## Why I created this gem?
|
54
53
|
|
55
54
|
I know there are many tools available for generating ERD,
|
56
|
-
|
57
|
-
|
58
|
-
If I want to generate local database using `Azimutt`, I have to setup `Azimutt` locally that is alot of step -\_-
|
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. -_-
|
59
57
|
|
60
58
|
## Roadmap
|
61
59
|
|
@@ -66,7 +64,7 @@ If I want to generate local database using `Azimutt`, I have to setup `Azimutt`
|
|
66
64
|
|
67
65
|
## Contributing
|
68
66
|
|
69
|
-
Pull requests are welcome.
|
67
|
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
|
70
68
|
|
71
69
|
## License
|
72
70
|
|
data/lib/erdb/adapters/sql.rb
CHANGED
@@ -37,6 +37,9 @@ module ERDB
|
|
37
37
|
#
|
38
38
|
def to_erdb
|
39
39
|
puts "\nAnalyzing database..."
|
40
|
+
|
41
|
+
raise "No tables found in database." if @connection.tables.empty?
|
42
|
+
|
40
43
|
@connection.tables.map do |table|
|
41
44
|
columns = @connection.columns(table).map { |column| { name: column.name, type: column.type || "unknown" } }
|
42
45
|
relations = @connection.foreign_keys(table).map do |fk|
|
data/lib/erdb/version.rb
CHANGED