blazer 2.2.7 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of blazer might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +119 -167
- data/app/assets/stylesheets/blazer/application.css +4 -0
- data/app/controllers/blazer/base_controller.rb +8 -0
- data/app/controllers/blazer/dashboards_controller.rb +3 -1
- data/app/controllers/blazer/queries_controller.rb +119 -3
- data/app/controllers/blazer/uploads_controller.rb +147 -0
- data/app/models/blazer/query.rb +9 -2
- data/app/models/blazer/upload.rb +11 -0
- data/app/models/blazer/uploads_connection.rb +7 -0
- data/app/views/blazer/_nav.html.erb +3 -0
- data/app/views/blazer/checks/_form.html.erb +1 -1
- data/app/views/blazer/checks/index.html.erb +3 -0
- data/app/views/blazer/dashboards/_form.html.erb +1 -1
- data/app/views/blazer/dashboards/show.html.erb +1 -1
- data/app/views/blazer/queries/_caching.html.erb +16 -0
- data/app/views/blazer/queries/_cohorts.html.erb +48 -0
- data/app/views/blazer/queries/docs.html.erb +6 -0
- data/app/views/blazer/queries/home.html.erb +3 -0
- data/app/views/blazer/queries/run.html.erb +15 -17
- data/app/views/blazer/queries/show.html.erb +1 -1
- data/app/views/blazer/uploads/_form.html.erb +27 -0
- data/app/views/blazer/uploads/edit.html.erb +3 -0
- data/app/views/blazer/uploads/index.html.erb +55 -0
- data/app/views/blazer/uploads/new.html.erb +3 -0
- data/config/routes.rb +5 -0
- data/lib/blazer.rb +22 -0
- data/lib/blazer/adapters/base_adapter.rb +8 -0
- data/lib/blazer/adapters/hive_adapter.rb +45 -0
- data/lib/blazer/adapters/spark_adapter.rb +9 -0
- data/lib/blazer/adapters/sql_adapter.rb +64 -1
- data/lib/blazer/data_source.rb +1 -1
- data/lib/blazer/version.rb +1 -1
- data/lib/generators/blazer/templates/config.yml.tt +6 -0
- data/lib/generators/blazer/templates/install.rb.tt +1 -0
- data/lib/generators/blazer/templates/uploads.rb.tt +10 -0
- data/lib/generators/blazer/uploads_generator.rb +18 -0
- data/lib/tasks/blazer.rake +9 -0
- metadata +20 -7
    
        data/lib/blazer/data_source.rb
    CHANGED
    
    | @@ -6,7 +6,7 @@ module Blazer | |
| 6 6 |  | 
| 7 7 | 
             
                attr_reader :id, :settings
         | 
| 8 8 |  | 
| 9 | 
            -
                def_delegators :adapter_instance, :schema, :tables, :preview_statement, :reconnect, :cost, :explain, :cancel
         | 
| 9 | 
            +
                def_delegators :adapter_instance, :schema, :tables, :preview_statement, :reconnect, :cost, :explain, :cancel, :supports_cohort_analysis?, :cohort_analysis_statement
         | 
| 10 10 |  | 
| 11 11 | 
             
                def initialize(id, settings)
         | 
| 12 12 | 
             
                  @id = id
         | 
    
        data/lib/blazer/version.rb
    CHANGED
    
    
| @@ -0,0 +1,18 @@ | |
| 1 | 
            +
            require "rails/generators/active_record"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Blazer
         | 
| 4 | 
            +
              module Generators
         | 
| 5 | 
            +
                class UploadsGenerator < Rails::Generators::Base
         | 
| 6 | 
            +
                  include ActiveRecord::Generators::Migration
         | 
| 7 | 
            +
                  source_root File.join(__dir__, "templates")
         | 
| 8 | 
            +
             | 
| 9 | 
            +
                  def copy_migration
         | 
| 10 | 
            +
                    migration_template "uploads.rb", "db/migrate/create_blazer_uploads.rb", migration_version: migration_version
         | 
| 11 | 
            +
                  end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  def migration_version
         | 
| 14 | 
            +
                    "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
         | 
| 15 | 
            +
                  end
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
            end
         | 
    
        data/lib/tasks/blazer.rake
    CHANGED
    
    | @@ -8,4 +8,13 @@ namespace :blazer do | |
| 8 8 | 
             
              task send_failing_checks: :environment do
         | 
| 9 9 | 
             
                Blazer.send_failing_checks
         | 
| 10 10 | 
             
              end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              desc "archive queries"
         | 
| 13 | 
            +
              task archive_queries: :environment do
         | 
| 14 | 
            +
                abort "Audits must be enabled to archive" unless Blazer.audit
         | 
| 15 | 
            +
                abort "Missing status column - see https://github.com/ankane/blazer#23" unless Blazer::Query.column_names.include?("status")
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                viewed_query_ids = Blazer::Audit.where("created_at > ?", 90.days.ago).group(:query_id).count.keys.compact
         | 
| 18 | 
            +
                Blazer::Query.active.where.not(id: viewed_query_ids).update_all(status: "archived")
         | 
| 19 | 
            +
              end
         | 
| 11 20 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: blazer
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2. | 
| 4 | 
            +
              version: 2.4.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Andrew Kane
         | 
| 8 | 
            -
            autorequire: | 
| 8 | 
            +
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2021-01-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: railties
         | 
| @@ -94,7 +94,7 @@ dependencies: | |
| 94 94 | 
             
                - - ">="
         | 
| 95 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 96 | 
             
                    version: '0'
         | 
| 97 | 
            -
            description: | 
| 97 | 
            +
            description:
         | 
| 98 98 | 
             
            email: andrew@chartkick.com
         | 
| 99 99 | 
             
            executables: []
         | 
| 100 100 | 
             
            extensions: []
         | 
| @@ -145,6 +145,7 @@ files: | |
| 145 145 | 
             
            - app/controllers/blazer/checks_controller.rb
         | 
| 146 146 | 
             
            - app/controllers/blazer/dashboards_controller.rb
         | 
| 147 147 | 
             
            - app/controllers/blazer/queries_controller.rb
         | 
| 148 | 
            +
            - app/controllers/blazer/uploads_controller.rb
         | 
| 148 149 | 
             
            - app/helpers/blazer/base_helper.rb
         | 
| 149 150 | 
             
            - app/mailers/blazer/check_mailer.rb
         | 
| 150 151 | 
             
            - app/mailers/blazer/slack_notifier.rb
         | 
| @@ -155,6 +156,8 @@ files: | |
| 155 156 | 
             
            - app/models/blazer/dashboard_query.rb
         | 
| 156 157 | 
             
            - app/models/blazer/query.rb
         | 
| 157 158 | 
             
            - app/models/blazer/record.rb
         | 
| 159 | 
            +
            - app/models/blazer/upload.rb
         | 
| 160 | 
            +
            - app/models/blazer/uploads_connection.rb
         | 
| 158 161 | 
             
            - app/views/blazer/_nav.html.erb
         | 
| 159 162 | 
             
            - app/views/blazer/_variables.html.erb
         | 
| 160 163 | 
             
            - app/views/blazer/check_mailer/failing_checks.html.erb
         | 
| @@ -167,6 +170,8 @@ files: | |
| 167 170 | 
             
            - app/views/blazer/dashboards/edit.html.erb
         | 
| 168 171 | 
             
            - app/views/blazer/dashboards/new.html.erb
         | 
| 169 172 | 
             
            - app/views/blazer/dashboards/show.html.erb
         | 
| 173 | 
            +
            - app/views/blazer/queries/_caching.html.erb
         | 
| 174 | 
            +
            - app/views/blazer/queries/_cohorts.html.erb
         | 
| 170 175 | 
             
            - app/views/blazer/queries/_form.html.erb
         | 
| 171 176 | 
             
            - app/views/blazer/queries/docs.html.erb
         | 
| 172 177 | 
             
            - app/views/blazer/queries/edit.html.erb
         | 
| @@ -175,6 +180,10 @@ files: | |
| 175 180 | 
             
            - app/views/blazer/queries/run.html.erb
         | 
| 176 181 | 
             
            - app/views/blazer/queries/schema.html.erb
         | 
| 177 182 | 
             
            - app/views/blazer/queries/show.html.erb
         | 
| 183 | 
            +
            - app/views/blazer/uploads/_form.html.erb
         | 
| 184 | 
            +
            - app/views/blazer/uploads/edit.html.erb
         | 
| 185 | 
            +
            - app/views/blazer/uploads/index.html.erb
         | 
| 186 | 
            +
            - app/views/blazer/uploads/new.html.erb
         | 
| 178 187 | 
             
            - app/views/layouts/blazer/application.html.erb
         | 
| 179 188 | 
             
            - config/routes.rb
         | 
| 180 189 | 
             
            - lib/blazer.rb
         | 
| @@ -185,6 +194,7 @@ files: | |
| 185 194 | 
             
            - lib/blazer/adapters/drill_adapter.rb
         | 
| 186 195 | 
             
            - lib/blazer/adapters/druid_adapter.rb
         | 
| 187 196 | 
             
            - lib/blazer/adapters/elasticsearch_adapter.rb
         | 
| 197 | 
            +
            - lib/blazer/adapters/hive_adapter.rb
         | 
| 188 198 | 
             
            - lib/blazer/adapters/influxdb_adapter.rb
         | 
| 189 199 | 
             
            - lib/blazer/adapters/mongodb_adapter.rb
         | 
| 190 200 | 
             
            - lib/blazer/adapters/neo4j_adapter.rb
         | 
| @@ -192,6 +202,7 @@ files: | |
| 192 202 | 
             
            - lib/blazer/adapters/salesforce_adapter.rb
         | 
| 193 203 | 
             
            - lib/blazer/adapters/snowflake_adapter.rb
         | 
| 194 204 | 
             
            - lib/blazer/adapters/soda_adapter.rb
         | 
| 205 | 
            +
            - lib/blazer/adapters/spark_adapter.rb
         | 
| 195 206 | 
             
            - lib/blazer/adapters/sql_adapter.rb
         | 
| 196 207 | 
             
            - lib/blazer/data_source.rb
         | 
| 197 208 | 
             
            - lib/blazer/detect_anomalies.R
         | 
| @@ -203,6 +214,8 @@ files: | |
| 203 214 | 
             
            - lib/generators/blazer/install_generator.rb
         | 
| 204 215 | 
             
            - lib/generators/blazer/templates/config.yml.tt
         | 
| 205 216 | 
             
            - lib/generators/blazer/templates/install.rb.tt
         | 
| 217 | 
            +
            - lib/generators/blazer/templates/uploads.rb.tt
         | 
| 218 | 
            +
            - lib/generators/blazer/uploads_generator.rb
         | 
| 206 219 | 
             
            - lib/tasks/blazer.rake
         | 
| 207 220 | 
             
            - licenses/LICENSE-ace.txt
         | 
| 208 221 | 
             
            - licenses/LICENSE-bootstrap.txt
         | 
| @@ -224,7 +237,7 @@ homepage: https://github.com/ankane/blazer | |
| 224 237 | 
             
            licenses:
         | 
| 225 238 | 
             
            - MIT
         | 
| 226 239 | 
             
            metadata: {}
         | 
| 227 | 
            -
            post_install_message: | 
| 240 | 
            +
            post_install_message:
         | 
| 228 241 | 
             
            rdoc_options: []
         | 
| 229 242 | 
             
            require_paths:
         | 
| 230 243 | 
             
            - lib
         | 
| @@ -239,8 +252,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 239 252 | 
             
                - !ruby/object:Gem::Version
         | 
| 240 253 | 
             
                  version: '0'
         | 
| 241 254 | 
             
            requirements: []
         | 
| 242 | 
            -
            rubygems_version: 3. | 
| 243 | 
            -
            signing_key: | 
| 255 | 
            +
            rubygems_version: 3.2.3
         | 
| 256 | 
            +
            signing_key:
         | 
| 244 257 | 
             
            specification_version: 4
         | 
| 245 258 | 
             
            summary: Explore your data with SQL. Easily create charts and dashboards, and share
         | 
| 246 259 | 
             
              them with your team.
         |