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 +4 -4
- data/CHANGES.md +8 -0
- data/README.md +11 -20
- data/lib/erdb/adapters/sql.rb +8 -1
- data/lib/erdb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd50d69ff105b8b36454c0bf0ea0e6856c542a918e76624cdc6b824b8a259fc5
|
4
|
+
data.tar.gz: cc008ed9f2e0a730954725fa344a4f34948552483e41640c010a6bac29a76e41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ac6553030f6d2c5d528626c0d366da1e714ddcf28731dd124eb1db2ea7a48595667788549708bf5f8f8f9ed102af49929808c48ae5842badf16de333e8e5522
|
7
|
+
data.tar.gz: cccb9ac0141ab61b74e739e67ac51d1994f0c25f3f7641f18fb7d074f5169095caf646703b751b7244448cd909669d12d201b8073901a48bfc56fbfef8150143
|
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,23 +44,20 @@ After install ERDB, you can use `erdb` command to generate ER Diagram.
|
|
50
44
|
erdb
|
51
45
|
```
|
52
46
|
|
53
|
-
|
47
|
+
It use chrome browser by default to genereate ERD.
|
48
|
+
You can use other browser by passing `--browser` option.
|
54
49
|
|
55
|
-
|
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
|
-
##
|
52
|
+
## Why I created this gem?
|
61
53
|
|
62
|
-
|
63
|
-
|
64
|
-
|
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.
|
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
|
|
data/lib/erdb/adapters/sql.rb
CHANGED
@@ -37,7 +37,14 @@ module ERDB
|
|
37
37
|
#
|
38
38
|
def to_erdb
|
39
39
|
puts "\nAnalyzing database..."
|
40
|
-
|
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
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.
|
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-
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|