Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davydovanton/rom_sql_graph
Display your DB (sql) association graph
https://github.com/davydovanton/rom_sql_graph
associations graph hanami rom ruby
Last synced: about 2 months ago
JSON representation
Display your DB (sql) association graph
- Host: GitHub
- URL: https://github.com/davydovanton/rom_sql_graph
- Owner: davydovanton
- License: mit
- Created: 2017-03-05T12:19:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-06T19:26:48.000Z (over 4 years ago)
- Last Synced: 2024-10-06T04:38:08.945Z (2 months ago)
- Topics: associations, graph, hanami, rom, ruby
- Language: Ruby
- Size: 22.5 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-hanami - rom_sql_graph - DB (sql) association graph for hanami and rom projects (Hanami Gem List / Database)
README
# RomSqlGraph
[Rom-rb](http://rom-rb.org) and [hanami](http://hanamirb.org) tool for generating db (sql) association graph.
**For generating image you need to install graphviz tool (http://www.graphviz.org)**
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rom_sql_graph'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install rom_sql_graph
## Usage
```ruby
# First: create rom repository object
repo = UserRepository.new# Second: get ROM container
rom_container = repo.container# Next: create Rom::Sql::Graph object
graph = RomSqlGraph.generate(rom_container)# Generate image or html file with your db associations
graph.generate_image
graph.generate_html# convert graph to any type
graph.to_a
graph.to_s
graph.to_json
```### Image example
![ossboard-graph](https://github.com/davydovanton/rom_sql_graph/blob/master/graph.jpg?raw=true)## TODO:
- [ ] add tests
- [x] generate html
- [ ] generate json## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rom_sql_graph. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).