adhoq 0.4.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/adhoq/current_tables.js +23 -0
  4. data/app/assets/javascripts/adhoq/previewer.js +52 -0
  5. data/app/controllers/adhoq/queries_controller.rb +1 -1
  6. data/app/helpers/adhoq/application_helper.rb +1 -1
  7. data/app/models/adhoq/execution.rb +2 -2
  8. data/app/models/adhoq/time_based_orders.rb +1 -1
  9. data/app/views/adhoq/application/_global_nav.html.erb +18 -0
  10. data/app/views/adhoq/current_tables/index.html.erb +53 -0
  11. data/app/views/adhoq/explains/create.html.erb +1 -0
  12. data/app/views/adhoq/explains/statement_invalid.html.erb +5 -0
  13. data/app/views/adhoq/previews/create.html.erb +21 -0
  14. data/app/views/adhoq/previews/statement_invalid.html.erb +4 -0
  15. data/app/views/adhoq/queries/_current_tables_leftbar.html.erb +14 -0
  16. data/app/views/adhoq/queries/_execution.html.erb +10 -0
  17. data/app/views/adhoq/queries/_form.html.erb +124 -0
  18. data/app/views/adhoq/queries/_queries.html.erb +16 -0
  19. data/app/views/adhoq/queries/_query.html.erb +67 -0
  20. data/app/views/adhoq/queries/edit.html.erb +13 -0
  21. data/app/views/adhoq/queries/index.html.erb +15 -0
  22. data/app/views/adhoq/queries/new.html.erb +12 -0
  23. data/app/views/adhoq/queries/show.html.erb +14 -0
  24. data/app/views/layouts/adhoq/application.html.erb +18 -0
  25. data/config/database.yml +25 -0
  26. data/lib/adhoq/engine.rb +1 -1
  27. data/lib/adhoq/version.rb +1 -1
  28. data/spec/factories/adhoq_queries.rb +9 -9
  29. metadata +40 -68
  30. data/app/assets/javascripts/adhoq/current_tables.js.coffee +0 -18
  31. data/app/assets/javascripts/adhoq/previewer.js.coffee +0 -34
  32. data/app/views/adhoq/application/_global_nav.html.slim +0 -12
  33. data/app/views/adhoq/current_tables/index.html.slim +0 -35
  34. data/app/views/adhoq/explains/create.html.slim +0 -2
  35. data/app/views/adhoq/explains/statement_invalid.html.slim +0 -5
  36. data/app/views/adhoq/previews/create.html.slim +0 -12
  37. data/app/views/adhoq/previews/statement_invalid.html.slim +0 -5
  38. data/app/views/adhoq/queries/_current_tables_leftbar.html.slim +0 -9
  39. data/app/views/adhoq/queries/_execution.html.slim +0 -10
  40. data/app/views/adhoq/queries/_form.html.slim +0 -93
  41. data/app/views/adhoq/queries/_queries.html.slim +0 -14
  42. data/app/views/adhoq/queries/_query.html.slim +0 -48
  43. data/app/views/adhoq/queries/edit.html.slim +0 -11
  44. data/app/views/adhoq/queries/index.html.slim +0 -11
  45. data/app/views/adhoq/queries/new.html.slim +0 -10
  46. data/app/views/adhoq/queries/show.html.slim +0 -11
  47. data/app/views/layouts/adhoq/application.html.slim +0 -15
@@ -0,0 +1,13 @@
1
+ <div class="col-md-12">
2
+ <ol class="breadcrumb">
3
+ <li><%= link_to 'Index', :queries %></li>
4
+ <li><%= link_to query_friendly_name(@query), @query %></li>
5
+ <li class="active"> Edit</li>
6
+ </ol>
7
+ </div>
8
+ <div class="col-md-12" id="main">
9
+ <section class="edit-query">
10
+ <%= render 'form', query: @query, title: "Edit query > #{query_friendly_name(@query)}" %>
11
+ </section>
12
+ </div>
13
+ <%= render 'current_tables_leftbar' %>
@@ -0,0 +1,15 @@
1
+ <div class="col-md-12">
2
+ <ol class="breadcrumb">
3
+ <li class="active">Index</li>
4
+ </ol>
5
+ </div>
6
+ <div class="col-md-3" id="queries">
7
+ <section class="queries">
8
+ <%= render 'queries', queries: @queries %>
9
+ </section>
10
+ </div>
11
+ <div class="col-md-9" id="the-query">
12
+ <% if first_query = @queries.first %>
13
+ <%= render 'query', query: first_query %>
14
+ <% end %>
15
+ </div>
@@ -0,0 +1,12 @@
1
+ <div class="col-md-12">
2
+ <ol class="breadcrumb">
3
+ <li><%= link_to 'Index', :queries %></li>
4
+ <li class="active"> New query</li>
5
+ </ol>
6
+ </div>
7
+ <div class="col-md-12" id="main">
8
+ <section class="new-query">
9
+ <%= render 'form', query: @query, title: 'New query' %>
10
+ </section>
11
+ </div>
12
+ <%= render 'current_tables_leftbar' %>
@@ -0,0 +1,14 @@
1
+ <div class="col-md-12">
2
+ <ol class="breadcrumb">
3
+ <li><%= link_to 'Index', :queries %></li>
4
+ <li class="active"><%= query_friendly_name(@query) %></li>
5
+ </ol>
6
+ </div>
7
+ <div class="col-md-3" id="queries">
8
+ <section class="queries">
9
+ <%= render 'queries', queries: ::Adhoq::Query.recent_first, highlight: @query %>
10
+ </section>
11
+ </div>
12
+ <div class="col-md-9" id="the-query">
13
+ <%= render 'query', query: @query %>
14
+ </div>
@@ -0,0 +1,18 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Adhoq</title>
5
+ <%= stylesheet_link_tag 'adhoq/application', media: 'all' %>
6
+ <%= javascript_include_tag 'adhoq/application' %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <%= render 'global_nav' %>
12
+
13
+ <div class="row" id="contents">
14
+ <%= yield %>
15
+ </div>
16
+ </div>
17
+ </body>
18
+ </html>
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
data/lib/adhoq/engine.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  # TODO where to write?
2
2
  require 'font-awesome-sass'
3
3
  require 'jquery-rails'
4
- require 'slim-rails'
5
4
  require 'active_decorator'
5
+ require 'sassc-rails'
6
6
 
7
7
  module Adhoq
8
8
  class Engine < ::Rails::Engine
data/lib/adhoq/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Adhoq
2
- VERSION = "0.4.0"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -2,14 +2,14 @@
2
2
 
3
3
  FactoryBot.define do
4
4
  factory :adhoq_query, class: 'Adhoq::Query' do
5
- name 'A query'
6
- description 'Simple simple SELECT'
7
- query 'SELECT 1'
5
+ name { 'A query' }
6
+ description { 'Simple simple SELECT' }
7
+ query { 'SELECT 1' }
8
8
 
9
9
  trait :complex do
10
- name 'adhoq current use'
11
- description 'Simple analysys: count execution per query'
12
- query <<-SQL.strip_heredoc
10
+ name { 'adhoq current use' }
11
+ description { 'Simple analysys: count execution per query' }
12
+ query { <<-SQL.strip_heredoc }
13
13
  SELECT
14
14
  q.id
15
15
  ,q.name
@@ -27,9 +27,9 @@ FactoryBot.define do
27
27
  end
28
28
 
29
29
  trait :greeting do
30
- name 'greeting'
31
- description 'Static query for testing data'
32
- query 'SELECT "hello" AS name ,"English greeting message" AS description'
30
+ name { 'greeting' }
31
+ description { 'Static query for testing data' }
32
+ query { 'SELECT "hello" AS name ,"English greeting message" AS description' }
33
33
  end
34
34
  end
35
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adhoq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyosuke MOROHASHI
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-09 00:00:00.000000000 Z
11
+ date: 2021-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,42 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: '5.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.0'
26
+ version: '5.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: axlsx
28
+ name: caxlsx
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '2.0'
33
+ version: '3.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '2.0'
41
- - !ruby/object:Gem::Dependency
42
- name: coffee-rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
40
+ version: '3.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: fog-aws
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -82,34 +68,20 @@ dependencies:
82
68
  version: '0.3'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: font-awesome-sass
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 4.2.0
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 4.2.0
97
- - !ruby/object:Gem::Dependency
98
- name: jquery-rails
99
71
  requirement: !ruby/object:Gem::Requirement
100
72
  requirements:
101
73
  - - ">="
102
74
  - !ruby/object:Gem::Version
103
- version: '0'
75
+ version: '4.2'
104
76
  type: :runtime
105
77
  prerelease: false
106
78
  version_requirements: !ruby/object:Gem::Requirement
107
79
  requirements:
108
80
  - - ">="
109
81
  - !ruby/object:Gem::Version
110
- version: '0'
82
+ version: '4.2'
111
83
  - !ruby/object:Gem::Dependency
112
- name: sass-rails
84
+ name: jquery-rails
113
85
  requirement: !ruby/object:Gem::Requirement
114
86
  requirements:
115
87
  - - ">="
@@ -123,7 +95,7 @@ dependencies:
123
95
  - !ruby/object:Gem::Version
124
96
  version: '0'
125
97
  - !ruby/object:Gem::Dependency
126
- name: slim-rails
98
+ name: sassc-rails
127
99
  requirement: !ruby/object:Gem::Requirement
128
100
  requirements:
129
101
  - - ">="
@@ -196,16 +168,16 @@ dependencies:
196
168
  name: factory_bot_rails
197
169
  requirement: !ruby/object:Gem::Requirement
198
170
  requirements:
199
- - - ">="
171
+ - - "~>"
200
172
  - !ruby/object:Gem::Version
201
- version: '0'
173
+ version: 4.11.1
202
174
  type: :development
203
175
  prerelease: false
204
176
  version_requirements: !ruby/object:Gem::Requirement
205
177
  requirements:
206
- - - ">="
178
+ - - "~>"
207
179
  - !ruby/object:Gem::Version
208
- version: '0'
180
+ version: 4.11.1
209
181
  - !ruby/object:Gem::Dependency
210
182
  name: launchy
211
183
  requirement: !ruby/object:Gem::Requirement
@@ -282,14 +254,14 @@ dependencies:
282
254
  requirements:
283
255
  - - ">="
284
256
  - !ruby/object:Gem::Version
285
- version: '0'
257
+ version: '1.4'
286
258
  type: :development
287
259
  prerelease: false
288
260
  version_requirements: !ruby/object:Gem::Requirement
289
261
  requirements:
290
262
  - - ">="
291
263
  - !ruby/object:Gem::Version
292
- version: '0'
264
+ version: '1.4'
293
265
  - !ruby/object:Gem::Dependency
294
266
  name: tapp
295
267
  requirement: !ruby/object:Gem::Requirement
@@ -329,8 +301,8 @@ files:
329
301
  - app/assets/javascripts/adhoq/bootstrap/tab.js
330
302
  - app/assets/javascripts/adhoq/bootstrap/tooltip.js
331
303
  - app/assets/javascripts/adhoq/bootstrap/transition.js
332
- - app/assets/javascripts/adhoq/current_tables.js.coffee
333
- - app/assets/javascripts/adhoq/previewer.js.coffee
304
+ - app/assets/javascripts/adhoq/current_tables.js
305
+ - app/assets/javascripts/adhoq/previewer.js
334
306
  - app/assets/stylesheets/adhoq/_bootstrap-compass.scss
335
307
  - app/assets/stylesheets/adhoq/_bootstrap-mincer.scss
336
308
  - app/assets/stylesheets/adhoq/_bootstrap-sprockets.scss
@@ -422,22 +394,23 @@ files:
422
394
  - app/models/adhoq/query.rb
423
395
  - app/models/adhoq/report.rb
424
396
  - app/models/adhoq/time_based_orders.rb
425
- - app/views/adhoq/application/_global_nav.html.slim
426
- - app/views/adhoq/current_tables/index.html.slim
427
- - app/views/adhoq/explains/create.html.slim
428
- - app/views/adhoq/explains/statement_invalid.html.slim
429
- - app/views/adhoq/previews/create.html.slim
430
- - app/views/adhoq/previews/statement_invalid.html.slim
431
- - app/views/adhoq/queries/_current_tables_leftbar.html.slim
432
- - app/views/adhoq/queries/_execution.html.slim
433
- - app/views/adhoq/queries/_form.html.slim
434
- - app/views/adhoq/queries/_queries.html.slim
435
- - app/views/adhoq/queries/_query.html.slim
436
- - app/views/adhoq/queries/edit.html.slim
437
- - app/views/adhoq/queries/index.html.slim
438
- - app/views/adhoq/queries/new.html.slim
439
- - app/views/adhoq/queries/show.html.slim
440
- - app/views/layouts/adhoq/application.html.slim
397
+ - app/views/adhoq/application/_global_nav.html.erb
398
+ - app/views/adhoq/current_tables/index.html.erb
399
+ - app/views/adhoq/explains/create.html.erb
400
+ - app/views/adhoq/explains/statement_invalid.html.erb
401
+ - app/views/adhoq/previews/create.html.erb
402
+ - app/views/adhoq/previews/statement_invalid.html.erb
403
+ - app/views/adhoq/queries/_current_tables_leftbar.html.erb
404
+ - app/views/adhoq/queries/_execution.html.erb
405
+ - app/views/adhoq/queries/_form.html.erb
406
+ - app/views/adhoq/queries/_queries.html.erb
407
+ - app/views/adhoq/queries/_query.html.erb
408
+ - app/views/adhoq/queries/edit.html.erb
409
+ - app/views/adhoq/queries/index.html.erb
410
+ - app/views/adhoq/queries/new.html.erb
411
+ - app/views/adhoq/queries/show.html.erb
412
+ - app/views/layouts/adhoq/application.html.erb
413
+ - config/database.yml
441
414
  - config/routes.rb
442
415
  - db/migrate/20141003095645_create_adhoq_queries.rb
443
416
  - db/migrate/20141006014750_create_adhoq_executions.rb
@@ -482,7 +455,7 @@ homepage: https://github.com/esminc/adhoq
482
455
  licenses:
483
456
  - MIT
484
457
  metadata: {}
485
- post_install_message:
458
+ post_install_message:
486
459
  rdoc_options: []
487
460
  require_paths:
488
461
  - lib
@@ -497,9 +470,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
497
470
  - !ruby/object:Gem::Version
498
471
  version: '0'
499
472
  requirements: []
500
- rubyforge_project:
501
- rubygems_version: 2.5.2.2
502
- signing_key:
473
+ rubygems_version: 3.2.8
474
+ signing_key:
503
475
  specification_version: 4
504
476
  summary: DB management console in the wild.
505
477
  test_files:
@@ -1,18 +0,0 @@
1
- loadCurrentTableTabOnce = ($el)->
2
- $el.load($el.find('a.loading').attr('href'))
3
-
4
- Adhoq.toggleCurrentTables = (action, elements)->
5
- loadCurrentTableTabOnce($('#current-tables'))
6
-
7
- $main = $(elements.main)
8
- $tables = $(elements.tables)
9
-
10
- if action is 'show'
11
- $main.addClass('col-md-6').removeClass('col-md-12')
12
- $tables.addClass('col-md-6').show()
13
- else
14
- $main.addClass('col-md-12').removeClass('col-md-6')
15
- $tables.addClass('col-md-6').hide()
16
-
17
- true
18
-
@@ -1,34 +0,0 @@
1
- class Previewer
2
- constructor: (@el)->
3
-
4
- init: ->
5
- @el.on 'adhoq:updatePreview', => @update()
6
-
7
- @el.on 'click', =>
8
- @el.trigger 'adhoq:updatePreview'
9
- false
10
-
11
- update: ->
12
- jQuery.ajax(
13
- type: @el.data('method'),
14
- url: @el.attr('href'),
15
- data: {query: @source()},
16
- complete: (xhr)=>
17
- @result().html(xhr.responseText)
18
- )
19
-
20
- source: ->
21
- $(@el.data('source')).val()
22
-
23
- result: ->
24
- $(@el.data('result'))
25
-
26
- Adhoq.enablePreview = ($el)->
27
- (new Previewer($el)).init()
28
-
29
- Adhoq.enablePreviewKeybordShortCut= ($textarea, previewSelector)->
30
- $textarea.on 'keyup', (ev)->
31
- if(ev.ctrlKey && ev.keyCode is 82)
32
- $(previewSelector).trigger('adhoq:updatePreview')
33
-
34
- false
@@ -1,12 +0,0 @@
1
- nav#global-nav.navbar.navbar-default(role='navigation')
2
- .container-fluid
3
- .navbar-header
4
- = link_to 'Adhoq', root_path, class: 'navbar-brand'
5
- .navbar-collapse.collapse
6
- ul.nav.navbar-nav.navbar-right
7
- - if main_app.respond_to?(:root_path)
8
- li
9
- = link_to main_app.root_path do
10
- i.fa.fa-arrow-circle-right.fa-pad-r
11
- | Main app
12
-