You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to Looker and their LookML, insights requires you to define your data model in a file called insights.yml.
You use the insights_export gem to generate this file from your Rails Models. (Adapters for other frameworks coming soon.)
That means we can't just plug insights into our database and start exploring, we need to duplicate the SQL model in YAML first. Wouldn't it be possible to fetch this model automatically from the database?
In Python, SQLAlchemy's automap feature is able to extract that kind of information, is there any Ruby library providing that feature?
The text was updated successfully, but these errors were encountered:
RazZziel
changed the title
Fetch table relations automatically
Fetch database model automatically
May 18, 2017
The best solution here is to write a python plugin that uses automap to generate the insights.yml file for your database. You then add it to your requirements.txt file and integrate with your workflow to keep the file up to date.
I'm sure it's somehow possible to extract your database schema in Ruby as well, but even then, having an extra step to generate the yml file adds many features:
custom variables
hide models and fields from endusers
the developers have control over what your business users see
version control on the data
worse case insurance: intruders only have read access to the generated sql and can't execute arbitrary queries
It is definitely possible to replace the file with a nice interface that lets you configure all of that online, but that's a bit of an overkill at this stage
The README of the project states:
That means we can't just plug insights into our database and start exploring, we need to duplicate the SQL model in YAML first. Wouldn't it be possible to fetch this model automatically from the database?
In Python, SQLAlchemy's automap feature is able to extract that kind of information, is there any Ruby library providing that feature?
The text was updated successfully, but these errors were encountered: