All Projects → esminc → Adhoq

esminc / Adhoq

Licence: mit
Rails engine to generate instant reports from adhoc SQL query.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Adhoq

Role core
🔐A Rails engine providing essential industry of Role-based access control.
Stars: ✭ 262 (+154.37%)
Mutual labels:  rails-engine
Blacklight
Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr) index.
Stars: ✭ 670 (+550.49%)
Mutual labels:  rails-engine
Swagger ui engine
Include swagger-ui as rails engine and document your API with simple JSON or YAML files.
Stars: ✭ 77 (-25.24%)
Mutual labels:  rails-engine
Commontator
A Rails engine for comments
Stars: ✭ 277 (+168.93%)
Mutual labels:  rails-engine
Rails email preview
Preview and edit app mailer templates in Rails.
Stars: ✭ 524 (+408.74%)
Mutual labels:  rails-engine
Alchemy cms
AlchemyCMS is a Rails CMS engine
Stars: ✭ 702 (+581.55%)
Mutual labels:  rails-engine
Goldencobra
CMS based on modules as Rails 4 engines
Stars: ✭ 21 (-79.61%)
Mutual labels:  rails-engine
Comfy Blog
Blog Engine for ComfortableMexicanSofa (Rails 5.2+)
Stars: ✭ 98 (-4.85%)
Mutual labels:  rails-engine
Stripe Rails
A Rails Engine for integrating with Stripe
Stars: ✭ 627 (+508.74%)
Mutual labels:  rails-engine
Tabler Rubygem
Rubygem for https://tabler.github.io
Stars: ✭ 77 (-25.24%)
Mutual labels:  rails-engine
Notifications
🛎 Notifications Center engine like GitHub or other application for any Rails applications.
Stars: ✭ 359 (+248.54%)
Mutual labels:  rails-engine
Maily
📫 Rails Engine to preview emails in the browser
Stars: ✭ 502 (+387.38%)
Mutual labels:  rails-engine
Abraham
Trackable application tours for Rails with i18n support
Stars: ✭ 52 (-49.51%)
Mutual labels:  rails-engine
Material icons
A simple Rails wrapper for Google Material Icons
Stars: ✭ 266 (+158.25%)
Mutual labels:  rails-engine
Masq
Mountable Rails engine that provides OpenID server/identity provider functionality
Stars: ✭ 84 (-18.45%)
Mutual labels:  rails-engine
rbac core
(Moved to https://github.com/rails-engine/role_core) A Rails engine providing essential industry of Role-based access control
Stars: ✭ 15 (-85.44%)
Mutual labels:  rails-engine
Fae
CMS for Rails. For Reals.
Stars: ✭ 701 (+580.58%)
Mutual labels:  rails-engine
Exception Track
Tracking ⚠️ exceptions for Rails application and store them in database.
Stars: ✭ 102 (-0.97%)
Mutual labels:  rails-engine
Thredded
The best Rails forums engine ever.
Stars: ✭ 1,263 (+1126.21%)
Mutual labels:  rails-engine
Sudo rails
🔒 Sudo mode for your Rails controllers
Stars: ✭ 66 (-35.92%)
Mutual labels:  rails-engine

Adhoq Build Status Code Climate Test Coverage

Rails engine to generate instant reports from adhoc SQL query.

adhoq

Features

  • Export ad-hoc SQL reports in some formats:
    • .csv
    • .json
    • .xlsx
  • Persist generated report as local file or in AWS S3
  • over Rails 5.1.X
  • Nice administration console with rails engine

Future planning

  • [ ] Label data substitution

Installation

Add this line to your application's Gemfile:

gem 'adhoq'

And then execute:

$ bundle

Or install it yourself as:

$ gem install adhoq

Usage

As Rails engine

Install migrations

$ bundle exec rake adhoq:install:migrations
$ bundle exec rake db:migrate

Mount it in config/routes.rb

Rails.application.routes.draw do
  root  to: 'hi#show'

  mount Adhoq::Engine => "/adhoq"
end

Edit initialization file in config/initializers/adhoq.rb

Adhoq.configure do |config|
  # if not set, use :on_the_fly.(default)
  config.storage       = [:local_file, Rails.root + './path/to/store/report/files']
  config.authorization = ->(controller) { controller.signed_in? }
end

See configuration example in dummy app.

Then restart server and try it out.

As Plain old library (application export helper)

Adhoq also provides report generation from SQL string, not from mounted rails engine.

execution = Adhoq::AdhocExecution.new(
  'xlsx',
  'SELECT "hello" AS name ,"English greeting message" AS description'
)

Adhoq::Reporter.generate(execution) #=> report data

Persistence is also available without engine via Adhoq::Storage::SomeClass#store. Below is example that generating report and persist to in Rails application report method.

execution = Adhoq::AdhocExecution.new(
  'xlsx',
  'SELECT "hello" AS name ,"English greeting message" AS description'
)

storage   = Storage::S3.new(
  'my-adhoq-bucket',
  aws_access_key_id: 'key_id',
  aws_secret_access_key: 'access_key'
)

# generate report and store it to S3, returns `key` to get report data
key = storage.store('.xlsx') { Adhoq::Reporter.generate(execution) }

...
storage.get(key) #=> report data

Contributing

  1. Fork it ( https://github.com/esminc/adhoq/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].