visual_query 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +59 -0
  4. data/Rakefile +23 -0
  5. data/app/assets/images/visual_query/ajax-loader.gif +0 -0
  6. data/app/assets/javascripts/visual_query/index.js +288 -0
  7. data/app/assets/stylesheets/visual_query/visual_query.css +161 -0
  8. data/app/controllers/queries_controller.rb +157 -0
  9. data/app/helpers/application_helper.rb +5 -0
  10. data/app/helpers/queries_helper.rb +43 -0
  11. data/app/views/queries/_columns.html.erb +5 -0
  12. data/app/views/queries/_command.html.erb +5 -0
  13. data/app/views/queries/_command_results_browser.html.erb +1 -0
  14. data/app/views/queries/_command_save.html.erb +1 -0
  15. data/app/views/queries/_commands_results.html.erb +2 -0
  16. data/app/views/queries/_filter.html.erb +6 -0
  17. data/app/views/queries/_list_all_relations.html.erb +8 -0
  18. data/app/views/queries/_list_joinable_relations.html.erb +10 -0
  19. data/app/views/queries/_list_relation.html.erb +8 -0
  20. data/app/views/queries/_name.html.erb +8 -0
  21. data/app/views/queries/_results.html.erb +14 -0
  22. data/app/views/queries/_results_column_filter.html.erb +3 -0
  23. data/app/views/queries/_results_column_hide.html.erb +3 -0
  24. data/app/views/queries/_results_column_human_name.html.erb +8 -0
  25. data/app/views/queries/_results_empty.html.erb +3 -0
  26. data/app/views/queries/_sort.html.erb +12 -0
  27. data/app/views/queries/_sort_condition.html.erb +18 -0
  28. data/app/views/queries/_url_root.html.erb +1 -0
  29. data/app/views/queries/_warning_large_result_set.html.erb +12 -0
  30. data/app/views/queries/filters/_boolean.html.erb +6 -0
  31. data/app/views/queries/filters/_date.html.erb +17 -0
  32. data/app/views/queries/filters/_datetime.html.erb +1 -0
  33. data/app/views/queries/filters/_decimal.html.erb +1 -0
  34. data/app/views/queries/filters/_integer.html.erb +1 -0
  35. data/app/views/queries/filters/_numeric.html.erb +6 -0
  36. data/app/views/queries/filters/_string.html.erb +1 -0
  37. data/app/views/queries/filters/_text.html.erb +6 -0
  38. data/app/views/queries/index.html.erb +39 -0
  39. data/app/views/queries/new.html.erb +27 -0
  40. data/app/views/queries/not_found.html.erb +1 -0
  41. data/app/views/queries/show.html.erb +40 -0
  42. data/app/views/queries/sql_form.html.erb +16 -0
  43. data/config/initializers/visual_query.rb +11 -0
  44. data/config/routes.rb +26 -0
  45. data/db/migrate/20130927090319_create_visual_query_schema.rb +9 -0
  46. data/db/migrate/20130927090400_create_visual_query_metadata_table.rb +16 -0
  47. data/lib/tasks/visual_query_tasks.rake +12 -0
  48. data/lib/tutuf/visual_query.rb +6 -0
  49. data/lib/tutuf/visual_query/base.rb +268 -0
  50. data/lib/tutuf/visual_query/common.rb +58 -0
  51. data/lib/tutuf/visual_query/metadata.rb +35 -0
  52. data/lib/tutuf/visual_query/single.rb +111 -0
  53. data/lib/tutuf/visual_query/sql.rb +20 -0
  54. data/lib/visual_query.rb +4 -0
  55. data/lib/visual_query/engine.rb +4 -0
  56. data/lib/visual_query/version.rb +3 -0
  57. data/test/dummy/README.rdoc +261 -0
  58. data/test/dummy/Rakefile +7 -0
  59. data/test/dummy/app/assets/javascripts/application.js +15 -0
  60. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  61. data/test/dummy/app/controllers/application_controller.rb +3 -0
  62. data/test/dummy/app/helpers/application_helper.rb +2 -0
  63. data/test/dummy/app/models/account.rb +3 -0
  64. data/test/dummy/app/models/address.rb +3 -0
  65. data/test/dummy/app/models/category.rb +3 -0
  66. data/test/dummy/app/models/composite_pk.rb +3 -0
  67. data/test/dummy/app/models/customer.rb +4 -0
  68. data/test/dummy/app/models/order.rb +4 -0
  69. data/test/dummy/app/models/person.rb +4 -0
  70. data/test/dummy/app/models/post.rb +3 -0
  71. data/test/dummy/app/models/product.rb +4 -0
  72. data/test/dummy/app/models/product_in.rb +3 -0
  73. data/test/dummy/app/models/product_out.rb +3 -0
  74. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  75. data/test/dummy/config.ru +4 -0
  76. data/test/dummy/config/application.rb +53 -0
  77. data/test/dummy/config/boot.rb +10 -0
  78. data/test/dummy/config/database.yml +12 -0
  79. data/test/dummy/config/environment.rb +5 -0
  80. data/test/dummy/config/environments/development.rb +29 -0
  81. data/test/dummy/config/environments/production.rb +65 -0
  82. data/test/dummy/config/environments/test.rb +33 -0
  83. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  84. data/test/dummy/config/initializers/inflections.rb +15 -0
  85. data/test/dummy/config/initializers/mime_types.rb +5 -0
  86. data/test/dummy/config/initializers/secret_token.rb +7 -0
  87. data/test/dummy/config/initializers/session_store.rb +8 -0
  88. data/test/dummy/config/initializers/visual_query.rb +1 -0
  89. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  90. data/test/dummy/config/locales/en.yml +5 -0
  91. data/test/dummy/config/routes.rb +3 -0
  92. data/test/dummy/db/migrate/20130927112446_create_tables.rb +77 -0
  93. data/test/dummy/db/structure.sql +651 -0
  94. data/test/dummy/log/development.log +1548 -0
  95. data/test/dummy/log/test.log +36575 -0
  96. data/test/dummy/public/404.html +26 -0
  97. data/test/dummy/public/422.html +26 -0
  98. data/test/dummy/public/500.html +25 -0
  99. data/test/dummy/public/favicon.ico +0 -0
  100. data/test/dummy/script/rails +6 -0
  101. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-h/-hj2e_RSTanfbfrP0tso5Q7actRM6_clE5hetFlQ2y8.cache +1 -0
  102. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/3B/3B_zqoNDfkO8wvAME66zxm9KzQaeDVSjnH0qC08yufM.cache +1 -0
  103. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5g/5g7dhxVp4YbZmFw_-T3aU2oYq2Z9Jgtps0CKneXYSS0.cache +2 -0
  104. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6-/6-CtZO6uG0yfwU8-098Sdy2wnfO0W6DbFu6B6DKYuiw.cache +1 -0
  105. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/8k/8kFIVN4cTS9KCQt_UIF5s_rcY-bMYlQpM489D98hvP4.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Au/AukU7t3xLnyCh7qW4u45q9YFmjVcYujmIFbnaOhF4Mo.cache +1 -0
  107. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Bm/Bmsq0vYQqlrtfq5s-W8kcfLvwcsPT_6_5XxXt9J_QOw.cache +1 -0
  108. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/CQ/CQLNg7a2TsUWgc7JXjDkjseMig_dPVm6AvqO2IWk5zg.cache +0 -0
  109. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FX/FX9ZXN3HEHR5hPzvxW8rakWEt2ot4IPJyDB67O7KPZk.cache +2 -0
  110. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Hv/HvOStITEkFHlcJCgaDnND6wzPw4dMmdAdZB1Xm6JfSA.cache +0 -0
  111. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NW/NWCtuFzfIgixavqY71NIAa4ajbsXxRuiLNjceHgQ24M.cache +2 -0
  112. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Ta/TaG641Ow168nkagg10mh6zuWS8RwWuawpHuMGakCVjU.cache +0 -0
  113. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VN/VNCapNKJLeponthNeFJhaBYs92UBT3P8PugENHP0474.cache +2 -0
  114. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VR/VRi0Hz7tc62H5Of9XVjyAk7vSNmMr8xeYowo6lSBnZg.cache +2 -0
  115. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Vg/Vgl_u6t3BvczgGi_ZJlyyo7xYSe-GgEshLofx-3QorI.cache +1 -0
  116. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Vq/VqGJMF3Cpvp3fw2IEIkE2tzdFo_OdcEmxN58BQwbVDY.cache +0 -0
  117. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/W6/W6DnXCIMHJ2i5hUkEiNeDLroWxW3VU18nq292n5jlts.cache +0 -0
  118. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Z7/Z7fH8ST-O3GMnDUKvtKHHTSObfH2Nbs0J1QS79i80yE.cache +0 -0
  119. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Zh/ZhrmuPgfbHthzikN8QSHR0Q0bLtSYS1Bzl9HauWeDfU.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bY/bYzYCY_bAGQGVGMbcxtKIhUYrgDQhmQVTmK50JrMNb8.cache +0 -0
  121. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eT/eTmCDSnc2m9ER5Cn85g84xyTkVLWKLbbwPFQo8eUAIg.cache +0 -0
  122. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/h-/h-taE7cHlbq76GUb5kHenjih_y66mO0w0lIZs7vY-0s.cache +1 -0
  123. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ji/jikmiWyu-cXN_ZJ4hgLc3kuCAY-QJY2jmPeXS4_9vZY.cache +0 -0
  124. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kC/kCijps52gsNlkYgT2Qzdz9UcSaxhcMGNfNL7MIiWk54.cache +1 -0
  125. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kQ/kQt-OsUDJg_sl1be-FqJ6Vhw4XVguw9_msZEwXP0Nh0.cache +0 -0
  126. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nd/ndbe-ZZWBqU5gLx5nxauCFvv963Zm3xqVEwVYQ7X_X8.cache +1 -0
  127. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/q6/q6BYa32YJF11eGVapO4ouNl6gayPIsARgMavlzZmoi0.cache +0 -0
  128. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/sm/sm7AdmddDYbFx4-eo_y_kaZspanmc-jiJeM8j2DXX5k.cache +1 -0
  129. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ux/uxPH9lLOW42lEQxJXnBizEObZReD8qkz6Eb6fdS6Ur4.cache +1 -0
  130. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wn/wn0ayyM-chRdwEPI11SLkFT-7G2-GcOX8UIIC2kOWLY.cache +1 -0
  131. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/x7/x7KkTV3ibfIEysLB_ug5bfmnn2VLV_BldukPR3EoPBk.cache +0 -0
  132. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xK/xKo0PfDcZuMh8oO-6Gr4j4S8eR2qUNY9Gau4kAxKIH0.cache +1 -0
  133. data/test/fixtures/accounts.yml +4 -0
  134. data/test/fixtures/categories.yml +3 -0
  135. data/test/fixtures/categories_posts.yml +3 -0
  136. data/test/fixtures/people.yml +8 -0
  137. data/test/fixtures/posts.yml +8 -0
  138. data/test/fixtures/product_ins.yml +15 -0
  139. data/test/fixtures/product_outs.yml +5 -0
  140. data/test/fixtures/products.yml +6 -0
  141. data/test/fixtures/saved_queries.rb +7 -0
  142. data/test/functional/queries_controller_test.rb +267 -0
  143. data/test/functional/routes_test.rb +111 -0
  144. data/test/integration/navigation_test.rb +10 -0
  145. data/test/test_helper.rb +15 -0
  146. data/test/unit/metadata_test.rb +10 -0
  147. data/test/unit/sql_test.rb +37 -0
  148. data/test/unit/visual_query_test.rb +648 -0
  149. metadata +381 -0
@@ -0,0 +1,1548 @@
1
+  (7.8ms) CREATE TABLE "schema_migrations" ("version" character varying(255) NOT NULL) 
2
+  (13.4ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
3
+ ActiveRecord::SchemaMigration Load (0.8ms) SELECT "schema_migrations".* FROM "schema_migrations"
4
+ Migrating to CreateVisualQuerySchema (20130927090319)
5
+  (0.2ms) BEGIN
6
+  (0.4ms) CREATE SCHEMA "tutuf::visual_query"
7
+ SQL (0.8ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20130927090319"]]
8
+  (6.1ms) COMMIT
9
+ Migrating to CreateVisualQueryMetadataTable (20130927090400)
10
+  (0.3ms) BEGIN
11
+  (17.4ms) CREATE TABLE "tutuf_visual_query_metadata" ("id" serial primary key, "name" character varying(63) NOT NULL, "params" text, "order_by" text, "created_at" timestamp) 
12
+  (5.5ms) CREATE UNIQUE INDEX "index_tutuf_visual_query_metadata_on_name" ON "tutuf_visual_query_metadata" ("name")
13
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20130927090400"]]
14
+  (0.5ms) COMMIT
15
+ Migrating to CreateTables (20130927112446)
16
+  (6.5ms) BEGIN
17
+  (8.0ms) CREATE TABLE "some_files" ("id" serial primary key, "name" character varying(255))
18
+  (7.8ms) CREATE TABLE "people" ("id" serial primary key, "name" character varying(255) NOT NULL, "age" integer) 
19
+  (3.2ms) CREATE TABLE "accounts" ("id" serial primary key, "name" character varying(255) NOT NULL, "person_id" integer NOT NULL)
20
+  (3.5ms) CREATE TABLE "addresses" ("id" serial primary key, "country" character varying(255) NOT NULL, "city" character varying(255) NOT NULL, "street" character varying(255) NOT NULL, "addressable_id" integer NOT NULL, "addressable_type" character varying(255) NOT NULL) 
21
+  (2.4ms) CREATE TABLE "customers" ("id" serial primary key, "name" character varying(255), "created_at" date, "vip" boolean NOT NULL)
22
+  (2.5ms) CREATE TABLE "orders" ("id" serial primary key, "name" character varying(255), "billing_customer_id" integer, "shipping_customer_id" integer) 
23
+  (3.9ms) CREATE TABLE "posts" ("id" serial primary key, "title" character varying(255), "body" text)
24
+  (1.8ms) CREATE TABLE "categories" ("id" serial primary key, "name" character varying(255)) 
25
+  (0.6ms) CREATE TABLE "categories_posts" ("category_id" integer NOT NULL, "post_id" integer NOT NULL)
26
+  (0.5ms) CREATE TABLE "composite_pks" ("first_id" integer NOT NULL, "second_id" integer NOT NULL, "name" character varying(255)) 
27
+  (0.8ms) ALTER TABLE composite_pks ADD PRIMARY KEY (first_id,second_id)
28
+  (1.8ms) CREATE TABLE "products" ("id" serial primary key, "name" character varying(255)) 
29
+  (1.5ms) CREATE TABLE "product_ins" ("id" serial primary key, "product_id" integer, "quantity" integer, "buy_price" integer)
30
+  (2.0ms) CREATE TABLE "product_outs" ("id" serial primary key, "product_id" integer, "quantity" integer, "sale_price" integer) 
31
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ($1) [["version", "20130927112446"]]
32
+  (0.8ms) COMMIT
33
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
34
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" ORDER BY version
35
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
36
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations" ORDER BY version
37
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
38
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations" ORDER BY version
39
+  (2.6ms) SELECT count(id) FROM tutuf_visual_query_metadata
40
+ Tutuf::VisualQuery::Metadata Exists (0.7ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' LIMIT 1
41
+  (0.1ms) BEGIN
42
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' LIMIT 1
43
+ SQL (2.8ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:41:52 UTC +00:00], ["name", "first"], ["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"people:age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"people:age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"first\"}}"]]
44
+  (5.6ms) CREATE VIEW "tutuf::visual_query"."first" AS SELECT "people"."age" AS "people:age" FROM "people"
45
+  (0.7ms) COMMIT
46
+ Tutuf::VisualQuery::Metadata Exists (0.5ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'raw_sql' LIMIT 1
47
+  (0.1ms) BEGIN
48
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'raw_sql' LIMIT 1
49
+ SQL (0.4ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:41:52 UTC +00:00], ["name", "raw_sql"], ["params", "{\"sql\":\"SELECT AVG(age) AS average_age FROM people\",\"query\":{\"name\":\"raw_sql\"}}"]]
50
+  (1.5ms) CREATE VIEW "tutuf::visual_query"."raw_sql" AS SELECT AVG(age) AS average_age FROM people
51
+  (0.4ms) COMMIT
52
+ Unable to load categories_post, underlying cause No such file to load -- categories_post
53
+
54
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `load'
55
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `block in load_file'
56
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:616:in `new_constants_in'
57
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:423:in `load_file'
58
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:324:in `require_or_load'
59
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:289:in `depend_on'
60
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:207:in `require_dependency'
61
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:773:in `try_to_load_dependency'
62
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:792:in `block in require_fixture_classes'
63
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `each'
64
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `require_fixture_classes'
65
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:768:in `fixtures'
66
+ /Users/sava/code/visual_query/test/test_helper.rb:17:in `<class:TestCase>'
67
+ /Users/sava/code/visual_query/test/test_helper.rb:11:in `<top (required)>'
68
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
69
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
70
+ visual_query_test.rb:2:in `<main>'
71
+  (1.9ms) ALTER TABLE "categories" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" DISABLE TRIGGER ALL;ALTER TABLE "some_files" DISABLE TRIGGER ALL;ALTER TABLE "people" DISABLE TRIGGER ALL;ALTER TABLE "accounts" DISABLE TRIGGER ALL;ALTER TABLE "addresses" DISABLE TRIGGER ALL;ALTER TABLE "customers" DISABLE TRIGGER ALL;ALTER TABLE "orders" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "categories_posts" DISABLE TRIGGER ALL;ALTER TABLE "composite_pks" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "product_ins" DISABLE TRIGGER ALL;ALTER TABLE "product_outs" DISABLE TRIGGER ALL
72
+  (0.1ms) BEGIN
73
+ Fixture Delete (0.7ms) DELETE FROM "accounts"
74
+ Fixture Insert (0.3ms) INSERT INTO "accounts" ("id", "name", "person_id") VALUES (1, 'jat', 1)
75
+ Fixture Delete (0.8ms) DELETE FROM "categories"
76
+ Fixture Insert (0.2ms) INSERT INTO "categories" ("id", "name") VALUES (1, 'first')
77
+ Fixture Delete (0.2ms) DELETE FROM "categories_posts"
78
+ Fixture Insert (0.2ms) INSERT INTO "categories_posts" ("category_id", "post_id") VALUES (1, 1)
79
+ Fixture Delete (0.6ms) DELETE FROM "people"
80
+ Fixture Insert (0.2ms) INSERT INTO "people" ("id", "name", "age") VALUES (1, 'John Atanasoff', 34)
81
+ Fixture Insert (0.1ms) INSERT INTO "people" ("id", "name", "age") VALUES (2, 'Джон Атанасов', 34)
82
+ Fixture Delete (0.6ms) DELETE FROM "posts"
83
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("id", "title", "body") VALUES (1, 'First post!', 'Wankers like first post')
84
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("id", "title", "body") VALUES (2, 'Màmìta Español', '')
85
+ Fixture Delete (0.6ms) DELETE FROM "product_ins"
86
+ Fixture Insert (0.2ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (1, 1, 23, 7)
87
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (2, 1, 14, 10)
88
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (3, 2, 67, 25)
89
+ Fixture Delete (0.5ms) DELETE FROM "product_outs"
90
+ Fixture Insert (0.2ms) INSERT INTO "product_outs" ("id", "product_id", "quantity", "sale_price") VALUES (1, 1, 45, 10)
91
+ Fixture Delete (0.6ms) DELETE FROM "products"
92
+ Fixture Insert (0.2ms) INSERT INTO "products" ("id", "name") VALUES (1, 'pencil')
93
+ Fixture Insert (0.1ms) INSERT INTO "products" ("id", "name") VALUES (2, 'bottle')
94
+  (0.3ms) COMMIT
95
+  (0.3ms) ALTER TABLE "categories" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" ENABLE TRIGGER ALL;ALTER TABLE "some_files" ENABLE TRIGGER ALL;ALTER TABLE "people" ENABLE TRIGGER ALL;ALTER TABLE "accounts" ENABLE TRIGGER ALL;ALTER TABLE "addresses" ENABLE TRIGGER ALL;ALTER TABLE "customers" ENABLE TRIGGER ALL;ALTER TABLE "orders" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "categories_posts" ENABLE TRIGGER ALL;ALTER TABLE "composite_pks" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "product_ins" ENABLE TRIGGER ALL;ALTER TABLE "product_outs" ENABLE TRIGGER ALL
96
+  (0.1ms) BEGIN
97
+ -----------------------------------------
98
+ VisualQueryTest: test_columns_all_content
99
+ -----------------------------------------
100
+  (0.1ms) ROLLBACK
101
+  (0.1ms) BEGIN
102
+ ------------------------------------------
103
+ VisualQueryTest: test_columns_all_selected
104
+ ------------------------------------------
105
+  (0.1ms) ROLLBACK
106
+  (0.1ms) BEGIN
107
+ -------------------------------------------------------
108
+ VisualQueryTest: test_columns_for_saving_selected_empty
109
+ -------------------------------------------------------
110
+  (0.1ms) ROLLBACK
111
+  (0.1ms) BEGIN
112
+ -----------------------------------------------------------
113
+ VisualQueryTest: test_columns_for_saving_selected_not_empty
114
+ -----------------------------------------------------------
115
+  (0.1ms) ROLLBACK
116
+  (0.1ms) BEGIN
117
+ ---------------------------------------------
118
+ VisualQueryTest: test_columns_not_all_content
119
+ ---------------------------------------------
120
+  (0.1ms) ROLLBACK
121
+  (0.3ms) BEGIN
122
+ ----------------------------------------------
123
+ VisualQueryTest: test_columns_not_all_selected
124
+ ----------------------------------------------
125
+  (0.1ms) ROLLBACK
126
+  (0.2ms) BEGIN
127
+ --------------------------------------------------------
128
+ VisualQueryTest: test_columns_with_composite_primary_key
129
+ --------------------------------------------------------
130
+  (0.1ms) ROLLBACK
131
+  (0.1ms) BEGIN
132
+ ---------------------------------------------------------
133
+ VisualQueryTest: test_columns_with_name_of_existing_query
134
+ ---------------------------------------------------------
135
+ Tutuf::VisualQuery::Metadata Load (0.4ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
136
+  (0.1ms) ROLLBACK
137
+  (0.1ms) BEGIN
138
+ ------------------------------------------------------------
139
+ VisualQueryTest: test_columns_with_name_of_nonexisting_query
140
+ ------------------------------------------------------------
141
+ PG::UndefinedTable: ERROR: relation "tutuf::visual_query.non existing" does not exist
142
+ LINE 5: WHERE a.attrelid = '"tutuf::visual_query"."no...
143
+ ^
144
+ : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
145
+ pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
146
+ FROM pg_attribute a LEFT JOIN pg_attrdef d
147
+ ON a.attrelid = d.adrelid AND a.attnum = d.adnum
148
+ WHERE a.attrelid = '"tutuf::visual_query"."non existing"'::regclass
149
+ AND a.attnum > 0 AND NOT a.attisdropped
150
+ ORDER BY a.attnum
151
+
152
+  (0.1ms) ROLLBACK
153
+  (0.1ms) BEGIN
154
+ ------------------------------------------------
155
+ VisualQueryTest: test_columns_without_query_name
156
+ ------------------------------------------------
157
+  (0.1ms) ROLLBACK
158
+  (0.1ms) BEGIN
159
+ --------------------------------------------------------------------
160
+ VisualQueryTest: test_data_type_exisitng_relation_nonexisting_column
161
+ --------------------------------------------------------------------
162
+  (0.1ms) ROLLBACK
163
+  (0.1ms) BEGIN
164
+ -----------------------------------------------
165
+ VisualQueryTest: test_data_type_existing_column
166
+ -----------------------------------------------
167
+  (0.1ms) ROLLBACK
168
+  (0.1ms) BEGIN
169
+ -----------------------------------------------------------------------
170
+ VisualQueryTest: test_data_type_nonexisitng_relation_nonexisting_column
171
+ -----------------------------------------------------------------------
172
+ PG::UndefinedTable: ERROR: relation "non existing" does not exist
173
+ LINE 5: WHERE a.attrelid = '"non existing"'::regclass
174
+ ^
175
+ : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
176
+ pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
177
+ FROM pg_attribute a LEFT JOIN pg_attrdef d
178
+ ON a.attrelid = d.adrelid AND a.attnum = d.adnum
179
+ WHERE a.attrelid = '"non existing"'::regclass
180
+ AND a.attnum > 0 AND NOT a.attisdropped
181
+ ORDER BY a.attnum
182
+
183
+  (0.1ms) ROLLBACK
184
+  (0.1ms) BEGIN
185
+ -----------------------------
186
+ VisualQueryTest: test_destroy
187
+ -----------------------------
188
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
189
+ Tutuf::VisualQuery::Metadata Load (0.3ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
190
+  (0.1ms) SAVEPOINT active_record_1
191
+ SQL (0.4ms) DELETE FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."id" = $1 [["id", 1]]
192
+  (1.2ms) DROP VIEW "tutuf::visual_query"."first"
193
+  (0.1ms) RELEASE SAVEPOINT active_record_1
194
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
195
+  (1.6ms) SELECT 1 FROM information_schema.views WHERE table_name='first' AND table_schema='tutuf::visual_query';
196
+  (0.1ms) ROLLBACK
197
+  (0.1ms) BEGIN
198
+ -----------------------------
199
+ VisualQueryTest: test_disable
200
+ -----------------------------
201
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
202
+  (0.6ms) DROP SCHEMA IF EXISTS "tutuf::visual_query" CASCADE
203
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
204
+  (0.5ms) SELECT 1 FROM information_schema.views WHERE table_schema='tutuf::visual_query'
205
+  (0.1ms) ROLLBACK
206
+  (0.1ms) BEGIN
207
+ ----------------------------
208
+ VisualQueryTest: test_enable
209
+ ----------------------------
210
+  (0.5ms) DROP SCHEMA IF EXISTS "tutuf::visual_query" CASCADE
211
+  (0.3ms) CREATE SCHEMA "tutuf::visual_query"
212
+ Tutuf::VisualQuery::Metadata Load (0.2ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" ORDER BY "tutuf_visual_query_metadata"."name" ASC
213
+ Tutuf::VisualQuery::Metadata Exists (0.4ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'first' AND "tutuf_visual_query_metadata"."id" != 1) LIMIT 1
214
+  (0.1ms) SAVEPOINT active_record_1
215
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'first' AND "tutuf_visual_query_metadata"."id" != 1) LIMIT 1
216
+ SQL (0.3ms) UPDATE "tutuf_visual_query_metadata" SET "params" = $1 WHERE "tutuf_visual_query_metadata"."id" = 1 [["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"people:age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"people:age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"first\"}}"]]
217
+  (0.5ms) CREATE VIEW "tutuf::visual_query"."first" AS SELECT "people"."age" FROM "people"
218
+  (0.1ms) RELEASE SAVEPOINT active_record_1
219
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'raw_sql' AND "tutuf_visual_query_metadata"."id" != 2) LIMIT 1
220
+  (0.1ms) SAVEPOINT active_record_1
221
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'raw_sql' AND "tutuf_visual_query_metadata"."id" != 2) LIMIT 1
222
+ SQL (0.2ms) UPDATE "tutuf_visual_query_metadata" SET "params" = $1 WHERE "tutuf_visual_query_metadata"."id" = 2 [["params", "{\"sql\":\"SELECT AVG(age) AS average_age FROM people\",\"query\":{\"name\":\"raw_sql\"}}"]]
223
+  (0.6ms) CREATE VIEW "tutuf::visual_query"."raw_sql" AS SELECT AVG(age) AS average_age FROM people
224
+  (0.1ms) RELEASE SAVEPOINT active_record_1
225
+  (0.6ms) SELECT 1 FROM information_schema.views WHERE table_name='first' AND table_schema='tutuf::visual_query';
226
+  (0.1ms) ROLLBACK
227
+  (0.2ms) BEGIN
228
+ ------------------------------
229
+ VisualQueryTest: test_find_all
230
+ ------------------------------
231
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
232
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
233
+  (0.1ms) ROLLBACK
234
+  (0.1ms) BEGIN
235
+ -------------------------------------------
236
+ VisualQueryTest: test_find_by_name_existing
237
+ -------------------------------------------
238
+ Tutuf::VisualQuery::Metadata Load (0.2ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
239
+  (0.1ms) ROLLBACK
240
+  (0.1ms) BEGIN
241
+ -----------------------------------------------
242
+ VisualQueryTest: test_find_by_name_not_existing
243
+ -----------------------------------------------
244
+ Tutuf::VisualQuery::Metadata Load (0.2ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
245
+  (0.1ms) ROLLBACK
246
+  (0.1ms) BEGIN
247
+ -----------------------------------------------
248
+ VisualQueryTest: test_is_new_on_existing_object
249
+ -----------------------------------------------
250
+ Tutuf::VisualQuery::Metadata Load (0.2ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
251
+  (0.1ms) ROLLBACK
252
+  (0.1ms) BEGIN
253
+ ------------------------------------------
254
+ VisualQueryTest: test_is_new_on_new_object
255
+ ------------------------------------------
256
+  (0.1ms) ROLLBACK
257
+  (0.1ms) BEGIN
258
+ --------------------------------------------------
259
+ VisualQueryTest: test_join_condition_on_belongs_to
260
+ --------------------------------------------------
261
+  (0.1ms) ROLLBACK
262
+  (0.3ms) BEGIN
263
+ -----------------------------------------------------------------------------
264
+ VisualQueryTest: test_join_condition_on_belongs_to_with_composite_primary_key
265
+ -----------------------------------------------------------------------------
266
+  (0.2ms) ROLLBACK
267
+  (0.2ms) BEGIN
268
+ ---------------------------------------------------------------
269
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many
270
+ ---------------------------------------------------------------
271
+  (0.1ms) ROLLBACK
272
+  (0.1ms) BEGIN
273
+ ------------------------------------------------------------------------------------------
274
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many_with_composite_primary_key
275
+ ------------------------------------------------------------------------------------------
276
+  (0.2ms) ROLLBACK
277
+  (0.1ms) BEGIN
278
+ --------------------------------------------------------------------------------------------
279
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many_with_polymorphic_association
280
+ --------------------------------------------------------------------------------------------
281
+  (0.1ms) ROLLBACK
282
+  (0.1ms) BEGIN
283
+ ---------------------------------------------------------------------------------------------------------------------------
284
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many_with_polymorphic_association_and_with_composite_primary_key
285
+ ---------------------------------------------------------------------------------------------------------------------------
286
+  (0.1ms) ROLLBACK
287
+  (0.1ms) BEGIN
288
+ ------------------------------------------------
289
+ VisualQueryTest: test_join_condition_on_has_many
290
+ ------------------------------------------------
291
+  (0.1ms) ROLLBACK
292
+  (0.2ms) BEGIN
293
+ ---------------------------------------------------------------------------
294
+ VisualQueryTest: test_join_condition_on_has_many_with_composite_primary_key
295
+ ---------------------------------------------------------------------------
296
+  (0.1ms) ROLLBACK
297
+  (0.1ms) BEGIN
298
+ -----------------------------------------------------------------------------
299
+ VisualQueryTest: test_join_condition_on_has_many_with_polymorphic_association
300
+ -----------------------------------------------------------------------------
301
+  (0.1ms) ROLLBACK
302
+  (0.1ms) BEGIN
303
+ ------------------------------------------------------------------------------------------------------------
304
+ VisualQueryTest: test_join_condition_on_has_many_with_polymorphic_association_and_with_composite_primary_key
305
+ ------------------------------------------------------------------------------------------------------------
306
+  (0.1ms) ROLLBACK
307
+  (0.1ms) BEGIN
308
+ -----------------------------------------------
309
+ VisualQueryTest: test_join_condition_on_has_one
310
+ -----------------------------------------------
311
+  (0.1ms) ROLLBACK
312
+  (0.1ms) BEGIN
313
+ --------------------------------------------------------------------------
314
+ VisualQueryTest: test_join_condition_on_has_one_with_composite_primary_key
315
+ --------------------------------------------------------------------------
316
+  (0.1ms) ROLLBACK
317
+  (0.1ms) BEGIN
318
+ ----------------------------------------------------------------------------
319
+ VisualQueryTest: test_join_condition_on_has_one_with_polymorphic_association
320
+ ----------------------------------------------------------------------------
321
+  (0.1ms) ROLLBACK
322
+  (0.1ms) BEGIN
323
+ -----------------------------------------------------------------------------------------------------------
324
+ VisualQueryTest: test_join_condition_on_has_one_with_polymorphic_association_and_with_composite_primary_key
325
+ -----------------------------------------------------------------------------------------------------------
326
+  (0.1ms) ROLLBACK
327
+  (0.1ms) BEGIN
328
+ -----------------------------------------------
329
+ VisualQueryTest: test_join_relations_belongs_to
330
+ -----------------------------------------------
331
+  (0.1ms) ROLLBACK
332
+  (0.1ms) BEGIN
333
+ ------------------------------------------------------------
334
+ VisualQueryTest: test_join_relations_has_and_belongs_to_many
335
+ ------------------------------------------------------------
336
+  (0.1ms) ROLLBACK
337
+  (0.1ms) BEGIN
338
+ ---------------------------------------------
339
+ VisualQueryTest: test_join_relations_has_many
340
+ ---------------------------------------------
341
+  (0.1ms) ROLLBACK
342
+  (0.1ms) BEGIN
343
+ --------------------------------------------
344
+ VisualQueryTest: test_join_relations_has_one
345
+ --------------------------------------------
346
+  (0.1ms) ROLLBACK
347
+  (0.1ms) BEGIN
348
+ ---------------------------------------------------
349
+ VisualQueryTest: test_joinable_relations_belongs_to
350
+ ---------------------------------------------------
351
+  (0.1ms) ROLLBACK
352
+  (0.1ms) BEGIN
353
+ ----------------------------------------------------------------
354
+ VisualQueryTest: test_joinable_relations_has_and_belongs_to_many
355
+ ----------------------------------------------------------------
356
+  (0.1ms) ROLLBACK
357
+  (0.1ms) BEGIN
358
+ -------------------------------------------------
359
+ VisualQueryTest: test_joinable_relations_has_many
360
+ -------------------------------------------------
361
+  (0.1ms) ROLLBACK
362
+  (0.1ms) BEGIN
363
+ ------------------------------------------------
364
+ VisualQueryTest: test_joinable_relations_has_one
365
+ ------------------------------------------------
366
+  (0.1ms) ROLLBACK
367
+  (0.1ms) BEGIN
368
+ -----------------------------
369
+ VisualQueryTest: test_klasses
370
+ -----------------------------
371
+  (0.1ms) ROLLBACK
372
+  (0.1ms) BEGIN
373
+ ----------------------------------------------------
374
+ VisualQueryTest: test_large_result_set_empty_results
375
+ ----------------------------------------------------
376
+  (0.1ms) ROLLBACK
377
+  (0.1ms) BEGIN
378
+ --------------------------------------------------
379
+ VisualQueryTest: test_large_result_set_nil_results
380
+ --------------------------------------------------
381
+  (0.1ms) ROLLBACK
382
+  (0.1ms) BEGIN
383
+ -------------------------------------------------------
384
+ VisualQueryTest: test_large_result_set_not_really_large
385
+ -------------------------------------------------------
386
+  (0.2ms) ROLLBACK
387
+  (0.1ms) BEGIN
388
+ ---------------------------------------------------
389
+ VisualQueryTest: test_large_result_set_really_large
390
+ ---------------------------------------------------
391
+  (0.2ms) ROLLBACK
392
+  (0.1ms) BEGIN
393
+ ---------------------------------------------
394
+ VisualQueryTest: test_name_on_loading_from_db
395
+ ---------------------------------------------
396
+ Tutuf::VisualQuery::Metadata Load (0.4ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
397
+  (0.2ms) ROLLBACK
398
+  (0.1ms) BEGIN
399
+ ---------------------------------
400
+ VisualQueryTest: test_name_on_new
401
+ ---------------------------------
402
+  (0.1ms) ROLLBACK
403
+  (0.1ms) BEGIN
404
+ -----------------------------------------------------------------
405
+ VisualQueryTest: test_parsed_filters_with_all_nonempty_conditions
406
+ -----------------------------------------------------------------
407
+  (0.1ms) ROLLBACK
408
+  (0.3ms) BEGIN
409
+ ---------------------------------------------------------
410
+ VisualQueryTest: test_parsed_filters_with_empty_condition
411
+ ---------------------------------------------------------
412
+  (0.1ms) ROLLBACK
413
+  (0.1ms) BEGIN
414
+ -----------------------------------------------------
415
+ VisualQueryTest: test_quote_relation_name_with_schema
416
+ -----------------------------------------------------
417
+  (0.1ms) ROLLBACK
418
+  (0.1ms) BEGIN
419
+ -----------------------------------------------------------
420
+ VisualQueryTest: test_quote_relation_name_with_schema_empty
421
+ -----------------------------------------------------------
422
+  (0.1ms) ROLLBACK
423
+  (0.1ms) BEGIN
424
+ ---------------------------------------------------------
425
+ VisualQueryTest: test_quote_relation_name_with_schema_nil
426
+ ---------------------------------------------------------
427
+  (0.1ms) ROLLBACK
428
+  (0.1ms) BEGIN
429
+ --------------------------------------------
430
+ VisualQueryTest: test_results_balanced_query
431
+ --------------------------------------------
432
+  (0.4ms) (SELECT "products"."name","product_ins"."quantity",NULL FROM "products" INNER JOIN "product_ins" ON "products"."id" = "product_ins"."product_id") UNION ALL (SELECT "products"."name",NULL,"product_outs"."quantity" FROM "products" INNER JOIN "product_outs" ON "products"."id" = "product_outs"."product_id")
433
+ Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]
434
+ ProductIn Load (0.3ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 1]]
435
+ ProductOut Load (0.3ms) SELECT "product_outs".* FROM "product_outs" WHERE "product_outs"."id" = $1 LIMIT 1 [["id", 1]]
436
+  (0.1ms) ROLLBACK
437
+  (0.1ms) BEGIN
438
+ ----------------------------------------------------------------
439
+ VisualQueryTest: test_results_balanced_query_with_hidden_columns
440
+ ----------------------------------------------------------------
441
+  (0.1ms) ROLLBACK
442
+  (0.1ms) BEGIN
443
+ ------------------------------------------
444
+ VisualQueryTest: test_results_one_relation
445
+ ------------------------------------------
446
+  (0.2ms) SELECT "people"."id","people"."name","people"."age" FROM "people"
447
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
448
+  (0.1ms) ROLLBACK
449
+  (0.1ms) BEGIN
450
+ ------------------------------------------------------
451
+ VisualQueryTest: test_results_one_relation_with_filter
452
+ ------------------------------------------------------
453
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
454
+  (0.1ms) SELECT "people"."name" FROM "people" WHERE "public"."people"."id" = 1
455
+  (0.1ms) ROLLBACK
456
+  (0.1ms) BEGIN
457
+ -----------------------------------------
458
+ VisualQueryTest: test_results_saved_query
459
+ -----------------------------------------
460
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
461
+  (0.1ms) SAVEPOINT active_record_1
462
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
463
+ SQL (0.3ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:41:52 UTC +00:00], ["name", "query for results"], ["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"query for results\"}}"]]
464
+  (0.5ms) CREATE VIEW "tutuf::visual_query"."query for results" AS SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
465
+  (0.1ms) RELEASE SAVEPOINT active_record_1
466
+  (0.1ms) SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
467
+  (0.1ms) ROLLBACK
468
+  (0.1ms) BEGIN
469
+ -------------------------------------------------------------------
470
+ VisualQueryTest: test_results_two_relations_has_and_belongs_to_many
471
+ -------------------------------------------------------------------
472
+  (0.3ms) SELECT "posts"."title","categories"."name" FROM "posts" INNER JOIN "categories_posts" ON "posts"."id" = "categories_posts"."post_id" INNER JOIN "categories" ON "categories_posts"."category_id" = "categories"."id"
473
+ Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
474
+ Post Load (0.3ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = $1 LIMIT 1 [["id", 1]]
475
+  (0.1ms) ROLLBACK
476
+  (0.1ms) BEGIN
477
+ ----------------------------------------------------------------------------------
478
+ VisualQueryTest: test_results_two_relations_has_and_belongs_to_many_join_type_full
479
+ ----------------------------------------------------------------------------------
480
+  (0.3ms) SELECT "posts"."title","categories"."name" FROM "posts" FULL JOIN "categories_posts" ON "posts"."id" = "categories_posts"."post_id" INNER JOIN "categories" ON "categories_posts"."category_id" = "categories"."id"
481
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
482
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = $1 LIMIT 1 [["id", 1]]
483
+  (0.1ms) ROLLBACK
484
+  (0.1ms) BEGIN
485
+ -------------------------------------------------------------------------------------
486
+ VisualQueryTest: test_results_two_relations_has_and_belongs_to_many_join_type_invalid
487
+ -------------------------------------------------------------------------------------
488
+  (0.3ms) SELECT "posts"."title","categories"."name" FROM "posts" INNER JOIN "categories_posts" ON "posts"."id" = "categories_posts"."post_id" INNER JOIN "categories" ON "categories_posts"."category_id" = "categories"."id"
489
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
490
+ Post Load (0.2ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = $1 LIMIT 1 [["id", 1]]
491
+  (0.1ms) ROLLBACK
492
+  (0.1ms) BEGIN
493
+ ---------------------------------------------------
494
+ VisualQueryTest: test_results_two_relations_has_one
495
+ ---------------------------------------------------
496
+  (0.3ms) SELECT "people"."id","people"."name","people"."age","accounts"."id","accounts"."name" FROM "accounts" INNER JOIN "people" ON "accounts"."person_id" = "people"."id"
497
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
498
+ Account Load (0.3ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]
499
+  (0.1ms) ROLLBACK
500
+  (0.1ms) BEGIN
501
+ -------------------------------------------------
502
+ VisualQueryTest: test_results_with_hidden_columns
503
+ -------------------------------------------------
504
+  (0.2ms) SELECT NULL,"people"."name","people"."age" FROM "people"
505
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
506
+  (0.1ms) ROLLBACK
507
+  (0.1ms) BEGIN
508
+ -----------------------------------------
509
+ VisualQueryTest: test_save_balanced_query
510
+ -----------------------------------------
511
+  (0.1ms) ROLLBACK
512
+  (0.1ms) BEGIN
513
+ ---------------------------------------------------------------------
514
+ VisualQueryTest: test_save_invalid_metadata_and_invalid_sql_generated
515
+ ---------------------------------------------------------------------
516
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
517
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
518
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
519
+  (0.1ms) SAVEPOINT active_record_1
520
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
521
+ SQL (0.3ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:41:52 UTC +00:00], ["name", "new query"], ["params", "{\"query\":{\"name\":\"new query\"}}"]]
522
+  (0.4ms) CREATE VIEW "tutuf::visual_query"."new query" AS
523
+ PG::SyntaxError: ERROR: syntax error at end of input
524
+ LINE 1: CREATE VIEW "tutuf::visual_query"."new query" AS
525
+ ^
526
+ : CREATE VIEW "tutuf::visual_query"."new query" AS
527
+  (0.3ms) ROLLBACK TO SAVEPOINT active_record_1
528
+  (0.5ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
529
+  (0.2ms) ROLLBACK
530
+  (0.2ms) BEGIN
531
+ -------------------------------------------------------------------
532
+ VisualQueryTest: test_save_invalid_metadata_and_valid_sql_generated
533
+ -------------------------------------------------------------------
534
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" IS NULL LIMIT 1
535
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" IS NULL LIMIT 1
536
+  (0.1ms) ROLLBACK
537
+  (0.1ms) BEGIN
538
+ ---------------------------------------------
539
+ VisualQueryTest: test_save_valid_visual_query
540
+ ---------------------------------------------
541
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
542
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
543
+  (0.1ms) SAVEPOINT active_record_1
544
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
545
+ SQL (0.2ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:41:52 UTC +00:00], ["name", "new query"], ["params", "{\"columns\":[{\"rel_name\":\"addresses\",\"col_name\":\"country\",\"save_name\":\"cntr\"}],\"relations\":[{\"rel_name\":\"addresses\"}],\"query\":{\"name\":\"new query\"}}"]]
546
+  (0.5ms) CREATE VIEW "tutuf::visual_query"."new query" AS SELECT "addresses"."country" AS "cntr" FROM "addresses"
547
+  (0.1ms) RELEASE SAVEPOINT active_record_1
548
+  (0.1ms) ROLLBACK
549
+  (0.1ms) BEGIN
550
+ ----------------------------
551
+ VisualQueryTest: test_schema
552
+ ----------------------------
553
+  (0.1ms) ROLLBACK
554
+  (0.1ms) BEGIN
555
+ ------------------------------------
556
+ VisualQueryTest: test_sort_ascending
557
+ ------------------------------------
558
+  (0.3ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id" ASC
559
+  (0.1ms) ROLLBACK
560
+  (0.1ms) BEGIN
561
+ -----------------------------------------
562
+ VisualQueryTest: test_sort_balanced_query
563
+ -----------------------------------------
564
+  (0.4ms) (SELECT "products"."id","product_ins"."buy_price",NULL FROM "products" INNER JOIN "product_ins" ON "products"."id" = "product_ins"."product_id" ORDER BY "products"."id" ) UNION ALL (SELECT "products"."id",NULL,"product_outs"."sale_price" FROM "products" INNER JOIN "product_outs" ON "products"."id" = "product_outs"."product_id" ORDER BY "products"."id" )
565
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]
566
+ ProductIn Load (0.2ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 1]]
567
+ ProductIn Load (0.2ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 2]]
568
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 2]]
569
+ ProductIn Load (0.2ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 3]]
570
+ ProductOut Load (0.2ms) SELECT "product_outs".* FROM "product_outs" WHERE "product_outs"."id" = $1 LIMIT 1 [["id", 1]]
571
+  (0.1ms) ROLLBACK
572
+  (0.3ms) BEGIN
573
+ -------------------------------------
574
+ VisualQueryTest: test_sort_descending
575
+ -------------------------------------
576
+  (0.1ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id" DESC
577
+  (0.1ms) ROLLBACK
578
+  (0.1ms) BEGIN
579
+ ---------------------------------------
580
+ VisualQueryTest: test_sort_no_direction
581
+ ---------------------------------------
582
+  (0.1ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id" 
583
+  (0.2ms) ROLLBACK
584
+  (0.1ms) BEGIN
585
+ -------------------------------------------------------
586
+ VisualQueryTest: test_sort_sql_injection_in_column_name
587
+ -------------------------------------------------------
588
+  (0.1ms) ROLLBACK
589
+  (0.1ms) BEGIN
590
+ -----------------------------------------------------
591
+ VisualQueryTest: test_sort_sql_injection_in_direction
592
+ -----------------------------------------------------
593
+  (0.1ms) ROLLBACK
594
+  (0.1ms) BEGIN
595
+ ---------------------------------------------------------
596
+ VisualQueryTest: test_sort_sql_injection_in_relation_name
597
+ ---------------------------------------------------------
598
+  (0.1ms) ROLLBACK
599
+  (0.1ms) BEGIN
600
+ -----------------------------------------------
601
+ VisualQueryTest: test_sort_with_empty_condition
602
+ -----------------------------------------------
603
+  (0.2ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id"
604
+  (0.1ms) ROLLBACK
605
+  (0.1ms) BEGIN
606
+ --------------------------------------------------------
607
+ VisualQueryTest: test_sql_injection_in_columns_semicolon
608
+ --------------------------------------------------------
609
+  (0.3ms) SELECT "people"."name; DELETE FROM schema_info;" FROM "people"
610
+ PG::UndefinedColumn: ERROR: column people.name; DELETE FROM schema_info; does not exist
611
+ LINE 1: SELECT "people"."name; DELETE FROM schema_info;" FROM "peopl...
612
+ ^
613
+ : SELECT "people"."name; DELETE FROM schema_info;" FROM "people"
614
+  (0.1ms) ROLLBACK
615
+  (0.1ms) BEGIN
616
+ -------------------------------------------------------------------------------------
617
+ VisualQueryTest: test_sql_injection_in_columns_semicolon_and_backslashed_double_quote
618
+ -------------------------------------------------------------------------------------
619
+  (0.2ms) SELECT "people"."name\""; DELETE FROM schema_info;" FROM "people"
620
+ PG::UndefinedColumn: ERROR: column people.name\"; DELETE FROM schema_info; does not exist
621
+ LINE 1: SELECT "people"."name\""; DELETE FROM schema_info;" FROM "pe...
622
+ ^
623
+ : SELECT "people"."name\""; DELETE FROM schema_info;" FROM "people"
624
+  (0.1ms) ROLLBACK
625
+  (0.1ms) BEGIN
626
+ -------------------------------------------------------------------------
627
+ VisualQueryTest: test_sql_injection_in_columns_semicolon_and_double_quote
628
+ -------------------------------------------------------------------------
629
+  (0.2ms) SELECT "people"."name""; DELETE FROM schema_info;" FROM "people"
630
+ PG::UndefinedColumn: ERROR: column people.name"; DELETE FROM schema_info; does not exist
631
+ LINE 1: SELECT "people"."name""; DELETE FROM schema_info;" FROM "peo...
632
+ ^
633
+ : SELECT "people"."name""; DELETE FROM schema_info;" FROM "people"
634
+  (0.2ms) ROLLBACK
635
+  (0.2ms) BEGIN
636
+ -----------------------------------------------------
637
+ VisualQueryTest: test_sql_injection_in_filters_column
638
+ -----------------------------------------------------
639
+  (0.2ms) ROLLBACK
640
+  (0.1ms) BEGIN
641
+ -------------------------------------------------------
642
+ VisualQueryTest: test_sql_injection_in_filters_operator
643
+ -------------------------------------------------------
644
+  (0.1ms) ROLLBACK
645
+  (0.1ms) BEGIN
646
+ -------------------------------------------------------
647
+ VisualQueryTest: test_sql_injection_in_filters_relation
648
+ -------------------------------------------------------
649
+  (0.1ms) ROLLBACK
650
+  (0.1ms) BEGIN
651
+ -----------------------------------------------------
652
+ VisualQueryTest: test_sql_injection_in_filters_schema
653
+ -----------------------------------------------------
654
+  (0.1ms) ROLLBACK
655
+  (0.2ms) BEGIN
656
+ ----------------------------------------------------
657
+ VisualQueryTest: test_sql_injection_in_filters_value
658
+ ----------------------------------------------------
659
+  (0.1ms) ROLLBACK
660
+  (0.1ms) BEGIN
661
+ ------------------------------------------------------
662
+ VisualQueryTest: test_sql_injection_in_join_conditions
663
+ ------------------------------------------------------
664
+  (0.1ms) ROLLBACK
665
+  (0.1ms) BEGIN
666
+ ----------------------------------------------------------
667
+ VisualQueryTest: test_sql_injection_in_relations_semicolon
668
+ ----------------------------------------------------------
669
+  (0.2ms) SELECT FROM "people; DELETE FROM schema_info;"
670
+ PG::UndefinedTable: ERROR: relation "people; DELETE FROM schema_info;" does not exist
671
+ LINE 1: SELECT FROM "people; DELETE FROM schema_info;"
672
+ ^
673
+ : SELECT FROM "people; DELETE FROM schema_info;"
674
+  (0.1ms) ROLLBACK
675
+  (0.1ms) BEGIN
676
+ ---------------------------------------------------------------------------------------
677
+ VisualQueryTest: test_sql_injection_in_relations_semicolon_and_backslashed_double_quote
678
+ ---------------------------------------------------------------------------------------
679
+  (0.1ms) SELECT FROM "people\""; DELETE FROM schema_info;"
680
+ PG::UndefinedTable: ERROR: relation "people\"; DELETE FROM schema_info;" does not exist
681
+ LINE 1: SELECT FROM "people\""; DELETE FROM schema_info;"
682
+ ^
683
+ : SELECT FROM "people\""; DELETE FROM schema_info;"
684
+  (0.1ms) ROLLBACK
685
+  (0.1ms) BEGIN
686
+ ---------------------------------------------------------------------------
687
+ VisualQueryTest: test_sql_injection_in_relations_semicolon_and_double_quote
688
+ ---------------------------------------------------------------------------
689
+  (0.2ms) SELECT FROM "people""; DELETE FROM schema_info;"
690
+ PG::UndefinedTable: ERROR: relation "people"; DELETE FROM schema_info;" does not exist
691
+ LINE 1: SELECT FROM "people""; DELETE FROM schema_info;"
692
+ ^
693
+ : SELECT FROM "people""; DELETE FROM schema_info;"
694
+  (0.1ms) ROLLBACK
695
+  (0.1ms) BEGIN
696
+ ----------------------------
697
+ VisualQueryTest: test_to_csv
698
+ ----------------------------
699
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
700
+  (0.1ms) SAVEPOINT active_record_1
701
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
702
+ SQL (0.3ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:41:52 UTC +00:00], ["name", "query for results"], ["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"query for results\"}}"]]
703
+  (0.6ms) CREATE VIEW "tutuf::visual_query"."query for results" AS SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
704
+  (0.1ms) RELEASE SAVEPOINT active_record_1
705
+  (0.1ms) SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
706
+  (0.1ms) ROLLBACK
707
+  (0.3ms) BEGIN
708
+ ----------------------------------------------
709
+ VisualQueryTest: test_to_json_without_escaping
710
+ ----------------------------------------------
711
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
712
+  (0.1ms) SAVEPOINT active_record_1
713
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
714
+ SQL (0.2ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:41:52 UTC +00:00], ["name", "query for results"], ["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"query for results\"}}"]]
715
+  (0.5ms) CREATE VIEW "tutuf::visual_query"."query for results" AS SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
716
+  (0.1ms) RELEASE SAVEPOINT active_record_1
717
+  (0.2ms) SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
718
+  (0.1ms) ROLLBACK
719
+  (0.1ms) BEGIN
720
+ ----------------------------------------------------------
721
+ VisualQueryTest: test_validate_name_cannot_be_empty_string
722
+ ----------------------------------------------------------
723
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = '' LIMIT 1
724
+  (0.1ms) ROLLBACK
725
+  (0.1ms) BEGIN
726
+ ----------------------------------------------------------------
727
+ VisualQueryTest: test_validate_name_cannot_be_more_than_63_chars
728
+ ----------------------------------------------------------------
729
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' LIMIT 1
730
+  (0.1ms) ROLLBACK
731
+  (0.1ms) BEGIN
732
+ -------------------------------------------------
733
+ VisualQueryTest: test_validate_name_cannot_be_nil
734
+ -------------------------------------------------
735
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" IS NULL LIMIT 1
736
+  (0.1ms) ROLLBACK
737
+  (0.3ms) BEGIN
738
+ --------------------------------------------------
739
+ VisualQueryTest: test_validate_name_must_be_unique
740
+ --------------------------------------------------
741
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' LIMIT 1
742
+  (0.1ms) ROLLBACK
743
+  (1.3ms) SELECT count(id) FROM tutuf_visual_query_metadata
744
+ Unable to load categories_post, underlying cause No such file to load -- categories_post
745
+
746
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `load'
747
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `block in load_file'
748
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:616:in `new_constants_in'
749
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:423:in `load_file'
750
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:324:in `require_or_load'
751
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:289:in `depend_on'
752
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:207:in `require_dependency'
753
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:773:in `try_to_load_dependency'
754
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:792:in `block in require_fixture_classes'
755
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `each'
756
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `require_fixture_classes'
757
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:768:in `fixtures'
758
+ /Users/sava/code/visual_query/test/test_helper.rb:14:in `<class:TestCase>'
759
+ /Users/sava/code/visual_query/test/test_helper.rb:8:in `<top (required)>'
760
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
761
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
762
+ visual_query_test.rb:2:in `<main>'
763
+  (0.9ms) ALTER TABLE "categories" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" DISABLE TRIGGER ALL;ALTER TABLE "some_files" DISABLE TRIGGER ALL;ALTER TABLE "people" DISABLE TRIGGER ALL;ALTER TABLE "accounts" DISABLE TRIGGER ALL;ALTER TABLE "addresses" DISABLE TRIGGER ALL;ALTER TABLE "customers" DISABLE TRIGGER ALL;ALTER TABLE "orders" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "categories_posts" DISABLE TRIGGER ALL;ALTER TABLE "composite_pks" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "product_ins" DISABLE TRIGGER ALL;ALTER TABLE "product_outs" DISABLE TRIGGER ALL
764
+  (0.1ms) BEGIN
765
+ Fixture Delete (0.4ms) DELETE FROM "accounts"
766
+ Fixture Insert (0.5ms) INSERT INTO "accounts" ("id", "name", "person_id") VALUES (1, 'jat', 1)
767
+ Fixture Delete (0.4ms) DELETE FROM "categories"
768
+ Fixture Insert (0.2ms) INSERT INTO "categories" ("id", "name") VALUES (1, 'first')
769
+ Fixture Delete (0.3ms) DELETE FROM "categories_posts"
770
+ Fixture Insert (0.2ms) INSERT INTO "categories_posts" ("category_id", "post_id") VALUES (1, 1)
771
+ Fixture Delete (0.3ms) DELETE FROM "people"
772
+ Fixture Insert (0.2ms) INSERT INTO "people" ("id", "name", "age") VALUES (1, 'John Atanasoff', 34)
773
+ Fixture Insert (0.2ms) INSERT INTO "people" ("id", "name", "age") VALUES (2, 'Джон Атанасов', 34)
774
+ Fixture Delete (0.2ms) DELETE FROM "posts"
775
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("id", "title", "body") VALUES (1, 'First post!', 'Wankers like first post')
776
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("id", "title", "body") VALUES (2, 'Màmìta Español', '')
777
+ Fixture Delete (0.2ms) DELETE FROM "product_ins"
778
+ Fixture Insert (0.2ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (1, 1, 23, 7)
779
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (2, 1, 14, 10)
780
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (3, 2, 67, 25)
781
+ Fixture Delete (0.3ms) DELETE FROM "product_outs"
782
+ Fixture Insert (0.1ms) INSERT INTO "product_outs" ("id", "product_id", "quantity", "sale_price") VALUES (1, 1, 45, 10)
783
+ Fixture Delete (0.2ms) DELETE FROM "products"
784
+ Fixture Insert (0.1ms) INSERT INTO "products" ("id", "name") VALUES (1, 'pencil')
785
+ Fixture Insert (0.1ms) INSERT INTO "products" ("id", "name") VALUES (2, 'bottle')
786
+  (3.0ms) COMMIT
787
+  (0.4ms) ALTER TABLE "categories" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" ENABLE TRIGGER ALL;ALTER TABLE "some_files" ENABLE TRIGGER ALL;ALTER TABLE "people" ENABLE TRIGGER ALL;ALTER TABLE "accounts" ENABLE TRIGGER ALL;ALTER TABLE "addresses" ENABLE TRIGGER ALL;ALTER TABLE "customers" ENABLE TRIGGER ALL;ALTER TABLE "orders" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "categories_posts" ENABLE TRIGGER ALL;ALTER TABLE "composite_pks" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "product_ins" ENABLE TRIGGER ALL;ALTER TABLE "product_outs" ENABLE TRIGGER ALL
788
+  (0.1ms) BEGIN
789
+ -----------------------------------------
790
+ VisualQueryTest: test_columns_all_content
791
+ -----------------------------------------
792
+  (0.1ms) ROLLBACK
793
+  (0.3ms) BEGIN
794
+ ------------------------------------------
795
+ VisualQueryTest: test_columns_all_selected
796
+ ------------------------------------------
797
+  (0.2ms) ROLLBACK
798
+  (0.1ms) BEGIN
799
+ -------------------------------------------------------
800
+ VisualQueryTest: test_columns_for_saving_selected_empty
801
+ -------------------------------------------------------
802
+  (0.1ms) ROLLBACK
803
+  (0.1ms) BEGIN
804
+ -----------------------------------------------------------
805
+ VisualQueryTest: test_columns_for_saving_selected_not_empty
806
+ -----------------------------------------------------------
807
+  (0.1ms) ROLLBACK
808
+  (0.1ms) BEGIN
809
+ ---------------------------------------------
810
+ VisualQueryTest: test_columns_not_all_content
811
+ ---------------------------------------------
812
+  (0.1ms) ROLLBACK
813
+  (0.1ms) BEGIN
814
+ ----------------------------------------------
815
+ VisualQueryTest: test_columns_not_all_selected
816
+ ----------------------------------------------
817
+  (0.1ms) ROLLBACK
818
+  (0.1ms) BEGIN
819
+ --------------------------------------------------------
820
+ VisualQueryTest: test_columns_with_composite_primary_key
821
+ --------------------------------------------------------
822
+  (0.1ms) ROLLBACK
823
+  (0.1ms) BEGIN
824
+ ---------------------------------------------------------
825
+ VisualQueryTest: test_columns_with_name_of_existing_query
826
+ ---------------------------------------------------------
827
+ Tutuf::VisualQuery::Metadata Load (0.8ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
828
+  (0.1ms) ROLLBACK
829
+  (0.3ms) BEGIN
830
+ ------------------------------------------------------------
831
+ VisualQueryTest: test_columns_with_name_of_nonexisting_query
832
+ ------------------------------------------------------------
833
+ PG::UndefinedTable: ERROR: relation "tutuf::visual_query.non existing" does not exist
834
+ LINE 5: WHERE a.attrelid = '"tutuf::visual_query"."no...
835
+ ^
836
+ : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
837
+ pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
838
+ FROM pg_attribute a LEFT JOIN pg_attrdef d
839
+ ON a.attrelid = d.adrelid AND a.attnum = d.adnum
840
+ WHERE a.attrelid = '"tutuf::visual_query"."non existing"'::regclass
841
+ AND a.attnum > 0 AND NOT a.attisdropped
842
+ ORDER BY a.attnum
843
+
844
+  (0.1ms) ROLLBACK
845
+  (0.3ms) BEGIN
846
+ ------------------------------------------------
847
+ VisualQueryTest: test_columns_without_query_name
848
+ ------------------------------------------------
849
+  (0.2ms) ROLLBACK
850
+  (0.1ms) BEGIN
851
+ --------------------------------------------------------------------
852
+ VisualQueryTest: test_data_type_exisitng_relation_nonexisting_column
853
+ --------------------------------------------------------------------
854
+  (0.1ms) ROLLBACK
855
+  (0.1ms) BEGIN
856
+ -----------------------------------------------
857
+ VisualQueryTest: test_data_type_existing_column
858
+ -----------------------------------------------
859
+  (0.1ms) ROLLBACK
860
+  (0.1ms) BEGIN
861
+ -----------------------------------------------------------------------
862
+ VisualQueryTest: test_data_type_nonexisitng_relation_nonexisting_column
863
+ -----------------------------------------------------------------------
864
+ PG::UndefinedTable: ERROR: relation "non existing" does not exist
865
+ LINE 5: WHERE a.attrelid = '"non existing"'::regclass
866
+ ^
867
+ : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
868
+ pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
869
+ FROM pg_attribute a LEFT JOIN pg_attrdef d
870
+ ON a.attrelid = d.adrelid AND a.attnum = d.adnum
871
+ WHERE a.attrelid = '"non existing"'::regclass
872
+ AND a.attnum > 0 AND NOT a.attisdropped
873
+ ORDER BY a.attnum
874
+
875
+  (0.1ms) ROLLBACK
876
+  (0.1ms) BEGIN
877
+ -----------------------------
878
+ VisualQueryTest: test_destroy
879
+ -----------------------------
880
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
881
+ Tutuf::VisualQuery::Metadata Load (0.3ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
882
+  (0.1ms) SAVEPOINT active_record_1
883
+ SQL (0.5ms) DELETE FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."id" = $1 [["id", 1]]
884
+  (0.6ms) DROP VIEW "tutuf::visual_query"."first"
885
+  (0.1ms) RELEASE SAVEPOINT active_record_1
886
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
887
+  (1.0ms) SELECT 1 FROM information_schema.views WHERE table_name='first' AND table_schema='tutuf::visual_query';
888
+  (0.1ms) ROLLBACK
889
+  (0.2ms) BEGIN
890
+ -----------------------------
891
+ VisualQueryTest: test_disable
892
+ -----------------------------
893
+  (0.6ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
894
+  (1.2ms) DROP SCHEMA IF EXISTS "tutuf::visual_query" CASCADE
895
+  (0.3ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
896
+  (0.9ms) SELECT 1 FROM information_schema.views WHERE table_schema='tutuf::visual_query'
897
+  (0.3ms) ROLLBACK
898
+  (0.1ms) BEGIN
899
+ ----------------------------
900
+ VisualQueryTest: test_enable
901
+ ----------------------------
902
+  (0.9ms) DROP SCHEMA IF EXISTS "tutuf::visual_query" CASCADE
903
+  (0.4ms) CREATE SCHEMA "tutuf::visual_query"
904
+ Tutuf::VisualQuery::Metadata Load (0.4ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" ORDER BY "tutuf_visual_query_metadata"."name" ASC
905
+ Tutuf::VisualQuery::Metadata Exists (0.5ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'first' AND "tutuf_visual_query_metadata"."id" != 1) LIMIT 1
906
+  (0.1ms) SAVEPOINT active_record_1
907
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'first' AND "tutuf_visual_query_metadata"."id" != 1) LIMIT 1
908
+ SQL (0.4ms) UPDATE "tutuf_visual_query_metadata" SET "params" = $1 WHERE "tutuf_visual_query_metadata"."id" = 1 [["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"people:age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"people:age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"first\"}}"]]
909
+  (0.7ms) CREATE VIEW "tutuf::visual_query"."first" AS SELECT "people"."age" FROM "people"
910
+  (0.1ms) RELEASE SAVEPOINT active_record_1
911
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'raw_sql' AND "tutuf_visual_query_metadata"."id" != 2) LIMIT 1
912
+  (0.1ms) SAVEPOINT active_record_1
913
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE ("tutuf_visual_query_metadata"."name" = 'raw_sql' AND "tutuf_visual_query_metadata"."id" != 2) LIMIT 1
914
+ SQL (0.3ms) UPDATE "tutuf_visual_query_metadata" SET "params" = $1 WHERE "tutuf_visual_query_metadata"."id" = 2 [["params", "{\"sql\":\"SELECT AVG(age) AS average_age FROM people\",\"query\":{\"name\":\"raw_sql\"}}"]]
915
+  (0.6ms) CREATE VIEW "tutuf::visual_query"."raw_sql" AS SELECT AVG(age) AS average_age FROM people
916
+  (0.1ms) RELEASE SAVEPOINT active_record_1
917
+  (0.5ms) SELECT 1 FROM information_schema.views WHERE table_name='first' AND table_schema='tutuf::visual_query';
918
+  (0.1ms) ROLLBACK
919
+  (0.1ms) BEGIN
920
+ ------------------------------
921
+ VisualQueryTest: test_find_all
922
+ ------------------------------
923
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
924
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
925
+  (0.1ms) ROLLBACK
926
+  (0.1ms) BEGIN
927
+ -------------------------------------------
928
+ VisualQueryTest: test_find_by_name_existing
929
+ -------------------------------------------
930
+ Tutuf::VisualQuery::Metadata Load (0.2ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
931
+  (0.1ms) ROLLBACK
932
+  (0.1ms) BEGIN
933
+ -----------------------------------------------
934
+ VisualQueryTest: test_find_by_name_not_existing
935
+ -----------------------------------------------
936
+ Tutuf::VisualQuery::Metadata Load (0.2ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
937
+  (0.1ms) ROLLBACK
938
+  (0.1ms) BEGIN
939
+ -----------------------------------------------
940
+ VisualQueryTest: test_is_new_on_existing_object
941
+ -----------------------------------------------
942
+ Tutuf::VisualQuery::Metadata Load (0.2ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
943
+  (0.1ms) ROLLBACK
944
+  (0.1ms) BEGIN
945
+ ------------------------------------------
946
+ VisualQueryTest: test_is_new_on_new_object
947
+ ------------------------------------------
948
+  (0.1ms) ROLLBACK
949
+  (0.1ms) BEGIN
950
+ --------------------------------------------------
951
+ VisualQueryTest: test_join_condition_on_belongs_to
952
+ --------------------------------------------------
953
+  (0.1ms) ROLLBACK
954
+  (0.4ms) BEGIN
955
+ -----------------------------------------------------------------------------
956
+ VisualQueryTest: test_join_condition_on_belongs_to_with_composite_primary_key
957
+ -----------------------------------------------------------------------------
958
+  (0.3ms) ROLLBACK
959
+  (0.1ms) BEGIN
960
+ ---------------------------------------------------------------
961
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many
962
+ ---------------------------------------------------------------
963
+  (0.1ms) ROLLBACK
964
+  (0.1ms) BEGIN
965
+ ------------------------------------------------------------------------------------------
966
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many_with_composite_primary_key
967
+ ------------------------------------------------------------------------------------------
968
+  (0.1ms) ROLLBACK
969
+  (0.1ms) BEGIN
970
+ --------------------------------------------------------------------------------------------
971
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many_with_polymorphic_association
972
+ --------------------------------------------------------------------------------------------
973
+  (0.1ms) ROLLBACK
974
+  (0.1ms) BEGIN
975
+ ---------------------------------------------------------------------------------------------------------------------------
976
+ VisualQueryTest: test_join_condition_on_has_and_belongs_to_many_with_polymorphic_association_and_with_composite_primary_key
977
+ ---------------------------------------------------------------------------------------------------------------------------
978
+  (0.1ms) ROLLBACK
979
+  (0.1ms) BEGIN
980
+ ------------------------------------------------
981
+ VisualQueryTest: test_join_condition_on_has_many
982
+ ------------------------------------------------
983
+  (0.1ms) ROLLBACK
984
+  (0.1ms) BEGIN
985
+ ---------------------------------------------------------------------------
986
+ VisualQueryTest: test_join_condition_on_has_many_with_composite_primary_key
987
+ ---------------------------------------------------------------------------
988
+  (0.1ms) ROLLBACK
989
+  (0.1ms) BEGIN
990
+ -----------------------------------------------------------------------------
991
+ VisualQueryTest: test_join_condition_on_has_many_with_polymorphic_association
992
+ -----------------------------------------------------------------------------
993
+  (0.1ms) ROLLBACK
994
+  (0.1ms) BEGIN
995
+ ------------------------------------------------------------------------------------------------------------
996
+ VisualQueryTest: test_join_condition_on_has_many_with_polymorphic_association_and_with_composite_primary_key
997
+ ------------------------------------------------------------------------------------------------------------
998
+  (0.1ms) ROLLBACK
999
+  (0.1ms) BEGIN
1000
+ -----------------------------------------------
1001
+ VisualQueryTest: test_join_condition_on_has_one
1002
+ -----------------------------------------------
1003
+  (0.1ms) ROLLBACK
1004
+  (0.1ms) BEGIN
1005
+ --------------------------------------------------------------------------
1006
+ VisualQueryTest: test_join_condition_on_has_one_with_composite_primary_key
1007
+ --------------------------------------------------------------------------
1008
+  (0.1ms) ROLLBACK
1009
+  (0.1ms) BEGIN
1010
+ ----------------------------------------------------------------------------
1011
+ VisualQueryTest: test_join_condition_on_has_one_with_polymorphic_association
1012
+ ----------------------------------------------------------------------------
1013
+  (0.1ms) ROLLBACK
1014
+  (0.1ms) BEGIN
1015
+ -----------------------------------------------------------------------------------------------------------
1016
+ VisualQueryTest: test_join_condition_on_has_one_with_polymorphic_association_and_with_composite_primary_key
1017
+ -----------------------------------------------------------------------------------------------------------
1018
+  (0.1ms) ROLLBACK
1019
+  (0.1ms) BEGIN
1020
+ -----------------------------------------------
1021
+ VisualQueryTest: test_join_relations_belongs_to
1022
+ -----------------------------------------------
1023
+  (0.1ms) ROLLBACK
1024
+  (0.1ms) BEGIN
1025
+ ------------------------------------------------------------
1026
+ VisualQueryTest: test_join_relations_has_and_belongs_to_many
1027
+ ------------------------------------------------------------
1028
+  (0.1ms) ROLLBACK
1029
+  (0.1ms) BEGIN
1030
+ ---------------------------------------------
1031
+ VisualQueryTest: test_join_relations_has_many
1032
+ ---------------------------------------------
1033
+  (0.1ms) ROLLBACK
1034
+  (0.1ms) BEGIN
1035
+ --------------------------------------------
1036
+ VisualQueryTest: test_join_relations_has_one
1037
+ --------------------------------------------
1038
+  (0.1ms) ROLLBACK
1039
+  (0.1ms) BEGIN
1040
+ ---------------------------------------------------
1041
+ VisualQueryTest: test_joinable_relations_belongs_to
1042
+ ---------------------------------------------------
1043
+  (0.1ms) ROLLBACK
1044
+  (0.1ms) BEGIN
1045
+ ----------------------------------------------------------------
1046
+ VisualQueryTest: test_joinable_relations_has_and_belongs_to_many
1047
+ ----------------------------------------------------------------
1048
+  (0.1ms) ROLLBACK
1049
+  (0.1ms) BEGIN
1050
+ -------------------------------------------------
1051
+ VisualQueryTest: test_joinable_relations_has_many
1052
+ -------------------------------------------------
1053
+  (0.1ms) ROLLBACK
1054
+  (0.1ms) BEGIN
1055
+ ------------------------------------------------
1056
+ VisualQueryTest: test_joinable_relations_has_one
1057
+ ------------------------------------------------
1058
+  (0.1ms) ROLLBACK
1059
+  (0.1ms) BEGIN
1060
+ -----------------------------
1061
+ VisualQueryTest: test_klasses
1062
+ -----------------------------
1063
+  (0.1ms) ROLLBACK
1064
+  (0.1ms) BEGIN
1065
+ ----------------------------------------------------
1066
+ VisualQueryTest: test_large_result_set_empty_results
1067
+ ----------------------------------------------------
1068
+  (0.1ms) ROLLBACK
1069
+  (0.1ms) BEGIN
1070
+ --------------------------------------------------
1071
+ VisualQueryTest: test_large_result_set_nil_results
1072
+ --------------------------------------------------
1073
+  (0.1ms) ROLLBACK
1074
+  (0.1ms) BEGIN
1075
+ -------------------------------------------------------
1076
+ VisualQueryTest: test_large_result_set_not_really_large
1077
+ -------------------------------------------------------
1078
+  (0.2ms) ROLLBACK
1079
+  (0.2ms) BEGIN
1080
+ ---------------------------------------------------
1081
+ VisualQueryTest: test_large_result_set_really_large
1082
+ ---------------------------------------------------
1083
+  (0.1ms) ROLLBACK
1084
+  (0.1ms) BEGIN
1085
+ ---------------------------------------------
1086
+ VisualQueryTest: test_name_on_loading_from_db
1087
+ ---------------------------------------------
1088
+ Tutuf::VisualQuery::Metadata Load (0.3ms) SELECT "tutuf_visual_query_metadata".* FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' ORDER BY "tutuf_visual_query_metadata"."name" ASC LIMIT 1
1089
+  (0.1ms) ROLLBACK
1090
+  (0.1ms) BEGIN
1091
+ ---------------------------------
1092
+ VisualQueryTest: test_name_on_new
1093
+ ---------------------------------
1094
+  (0.1ms) ROLLBACK
1095
+  (0.1ms) BEGIN
1096
+ -----------------------------------------------------------------
1097
+ VisualQueryTest: test_parsed_filters_with_all_nonempty_conditions
1098
+ -----------------------------------------------------------------
1099
+  (0.1ms) ROLLBACK
1100
+  (0.1ms) BEGIN
1101
+ ---------------------------------------------------------
1102
+ VisualQueryTest: test_parsed_filters_with_empty_condition
1103
+ ---------------------------------------------------------
1104
+  (0.1ms) ROLLBACK
1105
+  (0.1ms) BEGIN
1106
+ -----------------------------------------------------
1107
+ VisualQueryTest: test_quote_relation_name_with_schema
1108
+ -----------------------------------------------------
1109
+  (0.1ms) ROLLBACK
1110
+  (0.1ms) BEGIN
1111
+ -----------------------------------------------------------
1112
+ VisualQueryTest: test_quote_relation_name_with_schema_empty
1113
+ -----------------------------------------------------------
1114
+  (0.1ms) ROLLBACK
1115
+  (0.1ms) BEGIN
1116
+ ---------------------------------------------------------
1117
+ VisualQueryTest: test_quote_relation_name_with_schema_nil
1118
+ ---------------------------------------------------------
1119
+  (0.1ms) ROLLBACK
1120
+  (0.1ms) BEGIN
1121
+ --------------------------------------------
1122
+ VisualQueryTest: test_results_balanced_query
1123
+ --------------------------------------------
1124
+  (0.4ms) (SELECT "products"."name","product_ins"."quantity",NULL FROM "products" INNER JOIN "product_ins" ON "products"."id" = "product_ins"."product_id") UNION ALL (SELECT "products"."name",NULL,"product_outs"."quantity" FROM "products" INNER JOIN "product_outs" ON "products"."id" = "product_outs"."product_id")
1125
+ Product Load (0.3ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]
1126
+ ProductIn Load (0.3ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 1]]
1127
+ ProductOut Load (0.4ms) SELECT "product_outs".* FROM "product_outs" WHERE "product_outs"."id" = $1 LIMIT 1 [["id", 1]]
1128
+  (0.1ms) ROLLBACK
1129
+  (0.1ms) BEGIN
1130
+ ----------------------------------------------------------------
1131
+ VisualQueryTest: test_results_balanced_query_with_hidden_columns
1132
+ ----------------------------------------------------------------
1133
+  (0.1ms) ROLLBACK
1134
+  (0.1ms) BEGIN
1135
+ ------------------------------------------
1136
+ VisualQueryTest: test_results_one_relation
1137
+ ------------------------------------------
1138
+  (0.2ms) SELECT "people"."id","people"."name","people"."age" FROM "people"
1139
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
1140
+  (0.1ms) ROLLBACK
1141
+  (0.1ms) BEGIN
1142
+ ------------------------------------------------------
1143
+ VisualQueryTest: test_results_one_relation_with_filter
1144
+ ------------------------------------------------------
1145
+ Person Load (0.2ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
1146
+  (0.2ms) SELECT "people"."name" FROM "people" WHERE "public"."people"."id" = 1
1147
+  (0.1ms) ROLLBACK
1148
+  (0.1ms) BEGIN
1149
+ -----------------------------------------
1150
+ VisualQueryTest: test_results_saved_query
1151
+ -----------------------------------------
1152
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
1153
+  (0.1ms) SAVEPOINT active_record_1
1154
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
1155
+ SQL (1.1ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:42:21 UTC +00:00], ["name", "query for results"], ["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"query for results\"}}"]]
1156
+  (0.7ms) CREATE VIEW "tutuf::visual_query"."query for results" AS SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
1157
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1158
+  (0.1ms) SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
1159
+  (0.1ms) ROLLBACK
1160
+  (0.1ms) BEGIN
1161
+ -------------------------------------------------------------------
1162
+ VisualQueryTest: test_results_two_relations_has_and_belongs_to_many
1163
+ -------------------------------------------------------------------
1164
+  (0.3ms) SELECT "posts"."title","categories"."name" FROM "posts" INNER JOIN "categories_posts" ON "posts"."id" = "categories_posts"."post_id" INNER JOIN "categories" ON "categories_posts"."category_id" = "categories"."id"
1165
+ Category Load (0.3ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
1166
+ Post Load (0.3ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = $1 LIMIT 1 [["id", 1]]
1167
+  (0.1ms) ROLLBACK
1168
+  (0.2ms) BEGIN
1169
+ ----------------------------------------------------------------------------------
1170
+ VisualQueryTest: test_results_two_relations_has_and_belongs_to_many_join_type_full
1171
+ ----------------------------------------------------------------------------------
1172
+  (0.3ms) SELECT "posts"."title","categories"."name" FROM "posts" FULL JOIN "categories_posts" ON "posts"."id" = "categories_posts"."post_id" INNER JOIN "categories" ON "categories_posts"."category_id" = "categories"."id"
1173
+ Category Load (0.5ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
1174
+ Post Load (0.5ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = $1 LIMIT 1 [["id", 1]]
1175
+  (0.2ms) ROLLBACK
1176
+  (0.2ms) BEGIN
1177
+ -------------------------------------------------------------------------------------
1178
+ VisualQueryTest: test_results_two_relations_has_and_belongs_to_many_join_type_invalid
1179
+ -------------------------------------------------------------------------------------
1180
+  (0.2ms) SELECT "posts"."title","categories"."name" FROM "posts" INNER JOIN "categories_posts" ON "posts"."id" = "categories_posts"."post_id" INNER JOIN "categories" ON "categories_posts"."category_id" = "categories"."id"
1181
+ Category Load (0.2ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = $1 LIMIT 1 [["id", 1]]
1182
+ Post Load (0.4ms) SELECT "posts".* FROM "posts" WHERE "posts"."id" = $1 LIMIT 1 [["id", 1]]
1183
+  (0.2ms) ROLLBACK
1184
+  (0.2ms) BEGIN
1185
+ ---------------------------------------------------
1186
+ VisualQueryTest: test_results_two_relations_has_one
1187
+ ---------------------------------------------------
1188
+  (0.5ms) SELECT "people"."id","people"."name","people"."age","accounts"."id","accounts"."name" FROM "accounts" INNER JOIN "people" ON "accounts"."person_id" = "people"."id"
1189
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
1190
+ Account Load (0.4ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 1]]
1191
+  (0.1ms) ROLLBACK
1192
+  (0.1ms) BEGIN
1193
+ -------------------------------------------------
1194
+ VisualQueryTest: test_results_with_hidden_columns
1195
+ -------------------------------------------------
1196
+  (0.2ms) SELECT NULL,"people"."name","people"."age" FROM "people"
1197
+ Person Load (0.3ms) SELECT "people".* FROM "people" WHERE "people"."id" = $1 LIMIT 1 [["id", 1]]
1198
+  (0.1ms) ROLLBACK
1199
+  (0.1ms) BEGIN
1200
+ -----------------------------------------
1201
+ VisualQueryTest: test_save_balanced_query
1202
+ -----------------------------------------
1203
+  (0.1ms) ROLLBACK
1204
+  (0.1ms) BEGIN
1205
+ ---------------------------------------------------------------------
1206
+ VisualQueryTest: test_save_invalid_metadata_and_invalid_sql_generated
1207
+ ---------------------------------------------------------------------
1208
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
1209
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
1210
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
1211
+  (0.1ms) SAVEPOINT active_record_1
1212
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
1213
+ SQL (0.3ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:42:21 UTC +00:00], ["name", "new query"], ["params", "{\"query\":{\"name\":\"new query\"}}"]]
1214
+  (0.2ms) CREATE VIEW "tutuf::visual_query"."new query" AS
1215
+ PG::SyntaxError: ERROR: syntax error at end of input
1216
+ LINE 1: CREATE VIEW "tutuf::visual_query"."new query" AS
1217
+ ^
1218
+ : CREATE VIEW "tutuf::visual_query"."new query" AS
1219
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
1220
+  (0.2ms) SELECT COUNT(*) FROM "tutuf_visual_query_metadata"
1221
+  (0.2ms) ROLLBACK
1222
+  (0.1ms) BEGIN
1223
+ -------------------------------------------------------------------
1224
+ VisualQueryTest: test_save_invalid_metadata_and_valid_sql_generated
1225
+ -------------------------------------------------------------------
1226
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" IS NULL LIMIT 1
1227
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" IS NULL LIMIT 1
1228
+  (0.1ms) ROLLBACK
1229
+  (0.1ms) BEGIN
1230
+ ---------------------------------------------
1231
+ VisualQueryTest: test_save_valid_visual_query
1232
+ ---------------------------------------------
1233
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
1234
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
1235
+  (0.1ms) SAVEPOINT active_record_1
1236
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'new query' LIMIT 1
1237
+ SQL (0.3ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:42:21 UTC +00:00], ["name", "new query"], ["params", "{\"columns\":[{\"rel_name\":\"addresses\",\"col_name\":\"country\",\"save_name\":\"cntr\"}],\"relations\":[{\"rel_name\":\"addresses\"}],\"query\":{\"name\":\"new query\"}}"]]
1238
+  (0.6ms) CREATE VIEW "tutuf::visual_query"."new query" AS SELECT "addresses"."country" AS "cntr" FROM "addresses"
1239
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1240
+  (0.1ms) ROLLBACK
1241
+  (0.1ms) BEGIN
1242
+ ----------------------------
1243
+ VisualQueryTest: test_schema
1244
+ ----------------------------
1245
+  (0.1ms) ROLLBACK
1246
+  (0.1ms) BEGIN
1247
+ ------------------------------------
1248
+ VisualQueryTest: test_sort_ascending
1249
+ ------------------------------------
1250
+  (0.3ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id" ASC
1251
+  (0.1ms) ROLLBACK
1252
+  (0.1ms) BEGIN
1253
+ -----------------------------------------
1254
+ VisualQueryTest: test_sort_balanced_query
1255
+ -----------------------------------------
1256
+  (0.4ms) (SELECT "products"."id","product_ins"."buy_price",NULL FROM "products" INNER JOIN "product_ins" ON "products"."id" = "product_ins"."product_id" ORDER BY "products"."id" ) UNION ALL (SELECT "products"."id",NULL,"product_outs"."sale_price" FROM "products" INNER JOIN "product_outs" ON "products"."id" = "product_outs"."product_id" ORDER BY "products"."id" )
1257
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 1]]
1258
+ ProductIn Load (0.2ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 1]]
1259
+ ProductIn Load (0.2ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 2]]
1260
+ Product Load (0.2ms) SELECT "products".* FROM "products" WHERE "products"."id" = $1 LIMIT 1 [["id", 2]]
1261
+ ProductIn Load (0.2ms) SELECT "product_ins".* FROM "product_ins" WHERE "product_ins"."id" = $1 LIMIT 1 [["id", 3]]
1262
+ ProductOut Load (0.2ms) SELECT "product_outs".* FROM "product_outs" WHERE "product_outs"."id" = $1 LIMIT 1 [["id", 1]]
1263
+  (0.1ms) ROLLBACK
1264
+  (0.3ms) BEGIN
1265
+ -------------------------------------
1266
+ VisualQueryTest: test_sort_descending
1267
+ -------------------------------------
1268
+  (0.1ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id" DESC
1269
+  (0.1ms) ROLLBACK
1270
+  (0.1ms) BEGIN
1271
+ ---------------------------------------
1272
+ VisualQueryTest: test_sort_no_direction
1273
+ ---------------------------------------
1274
+  (0.1ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id" 
1275
+  (0.1ms) ROLLBACK
1276
+  (0.1ms) BEGIN
1277
+ -------------------------------------------------------
1278
+ VisualQueryTest: test_sort_sql_injection_in_column_name
1279
+ -------------------------------------------------------
1280
+  (0.1ms) ROLLBACK
1281
+  (0.1ms) BEGIN
1282
+ -----------------------------------------------------
1283
+ VisualQueryTest: test_sort_sql_injection_in_direction
1284
+ -----------------------------------------------------
1285
+  (0.1ms) ROLLBACK
1286
+  (0.1ms) BEGIN
1287
+ ---------------------------------------------------------
1288
+ VisualQueryTest: test_sort_sql_injection_in_relation_name
1289
+ ---------------------------------------------------------
1290
+  (0.1ms) ROLLBACK
1291
+  (0.1ms) BEGIN
1292
+ -----------------------------------------------
1293
+ VisualQueryTest: test_sort_with_empty_condition
1294
+ -----------------------------------------------
1295
+  (0.1ms) SELECT "people"."id" FROM "people" ORDER BY "people"."id"
1296
+  (0.1ms) ROLLBACK
1297
+  (0.1ms) BEGIN
1298
+ --------------------------------------------------------
1299
+ VisualQueryTest: test_sql_injection_in_columns_semicolon
1300
+ --------------------------------------------------------
1301
+  (0.2ms) SELECT "people"."name; DELETE FROM schema_info;" FROM "people"
1302
+ PG::UndefinedColumn: ERROR: column people.name; DELETE FROM schema_info; does not exist
1303
+ LINE 1: SELECT "people"."name; DELETE FROM schema_info;" FROM "peopl...
1304
+ ^
1305
+ : SELECT "people"."name; DELETE FROM schema_info;" FROM "people"
1306
+  (0.1ms) ROLLBACK
1307
+  (0.1ms) BEGIN
1308
+ -------------------------------------------------------------------------------------
1309
+ VisualQueryTest: test_sql_injection_in_columns_semicolon_and_backslashed_double_quote
1310
+ -------------------------------------------------------------------------------------
1311
+  (0.2ms) SELECT "people"."name\""; DELETE FROM schema_info;" FROM "people"
1312
+ PG::UndefinedColumn: ERROR: column people.name\"; DELETE FROM schema_info; does not exist
1313
+ LINE 1: SELECT "people"."name\""; DELETE FROM schema_info;" FROM "pe...
1314
+ ^
1315
+ : SELECT "people"."name\""; DELETE FROM schema_info;" FROM "people"
1316
+  (0.1ms) ROLLBACK
1317
+  (0.1ms) BEGIN
1318
+ -------------------------------------------------------------------------
1319
+ VisualQueryTest: test_sql_injection_in_columns_semicolon_and_double_quote
1320
+ -------------------------------------------------------------------------
1321
+  (0.2ms) SELECT "people"."name""; DELETE FROM schema_info;" FROM "people"
1322
+ PG::UndefinedColumn: ERROR: column people.name"; DELETE FROM schema_info; does not exist
1323
+ LINE 1: SELECT "people"."name""; DELETE FROM schema_info;" FROM "peo...
1324
+ ^
1325
+ : SELECT "people"."name""; DELETE FROM schema_info;" FROM "people"
1326
+  (0.1ms) ROLLBACK
1327
+  (0.1ms) BEGIN
1328
+ -----------------------------------------------------
1329
+ VisualQueryTest: test_sql_injection_in_filters_column
1330
+ -----------------------------------------------------
1331
+  (0.1ms) ROLLBACK
1332
+  (0.1ms) BEGIN
1333
+ -------------------------------------------------------
1334
+ VisualQueryTest: test_sql_injection_in_filters_operator
1335
+ -------------------------------------------------------
1336
+  (0.1ms) ROLLBACK
1337
+  (0.1ms) BEGIN
1338
+ -------------------------------------------------------
1339
+ VisualQueryTest: test_sql_injection_in_filters_relation
1340
+ -------------------------------------------------------
1341
+  (0.1ms) ROLLBACK
1342
+  (0.3ms) BEGIN
1343
+ -----------------------------------------------------
1344
+ VisualQueryTest: test_sql_injection_in_filters_schema
1345
+ -----------------------------------------------------
1346
+  (0.1ms) ROLLBACK
1347
+  (0.1ms) BEGIN
1348
+ ----------------------------------------------------
1349
+ VisualQueryTest: test_sql_injection_in_filters_value
1350
+ ----------------------------------------------------
1351
+  (0.1ms) ROLLBACK
1352
+  (0.1ms) BEGIN
1353
+ ------------------------------------------------------
1354
+ VisualQueryTest: test_sql_injection_in_join_conditions
1355
+ ------------------------------------------------------
1356
+  (0.1ms) ROLLBACK
1357
+  (0.1ms) BEGIN
1358
+ ----------------------------------------------------------
1359
+ VisualQueryTest: test_sql_injection_in_relations_semicolon
1360
+ ----------------------------------------------------------
1361
+  (0.2ms) SELECT FROM "people; DELETE FROM schema_info;"
1362
+ PG::UndefinedTable: ERROR: relation "people; DELETE FROM schema_info;" does not exist
1363
+ LINE 1: SELECT FROM "people; DELETE FROM schema_info;"
1364
+ ^
1365
+ : SELECT FROM "people; DELETE FROM schema_info;"
1366
+  (0.1ms) ROLLBACK
1367
+  (0.1ms) BEGIN
1368
+ ---------------------------------------------------------------------------------------
1369
+ VisualQueryTest: test_sql_injection_in_relations_semicolon_and_backslashed_double_quote
1370
+ ---------------------------------------------------------------------------------------
1371
+  (0.2ms) SELECT FROM "people\""; DELETE FROM schema_info;"
1372
+ PG::UndefinedTable: ERROR: relation "people\"; DELETE FROM schema_info;" does not exist
1373
+ LINE 1: SELECT FROM "people\""; DELETE FROM schema_info;"
1374
+ ^
1375
+ : SELECT FROM "people\""; DELETE FROM schema_info;"
1376
+  (0.1ms) ROLLBACK
1377
+  (0.1ms) BEGIN
1378
+ ---------------------------------------------------------------------------
1379
+ VisualQueryTest: test_sql_injection_in_relations_semicolon_and_double_quote
1380
+ ---------------------------------------------------------------------------
1381
+  (0.2ms) SELECT FROM "people""; DELETE FROM schema_info;"
1382
+ PG::UndefinedTable: ERROR: relation "people"; DELETE FROM schema_info;" does not exist
1383
+ LINE 1: SELECT FROM "people""; DELETE FROM schema_info;"
1384
+ ^
1385
+ : SELECT FROM "people""; DELETE FROM schema_info;"
1386
+  (0.1ms) ROLLBACK
1387
+  (0.1ms) BEGIN
1388
+ ----------------------------
1389
+ VisualQueryTest: test_to_csv
1390
+ ----------------------------
1391
+ Tutuf::VisualQuery::Metadata Exists (0.4ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
1392
+  (0.2ms) SAVEPOINT active_record_1
1393
+ Tutuf::VisualQuery::Metadata Exists (0.5ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
1394
+ SQL (0.5ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:42:21 UTC +00:00], ["name", "query for results"], ["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"query for results\"}}"]]
1395
+  (1.1ms) CREATE VIEW "tutuf::visual_query"."query for results" AS SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
1396
+  (0.2ms) RELEASE SAVEPOINT active_record_1
1397
+  (0.3ms) SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
1398
+  (0.2ms) ROLLBACK
1399
+  (0.2ms) BEGIN
1400
+ ----------------------------------------------
1401
+ VisualQueryTest: test_to_json_without_escaping
1402
+ ----------------------------------------------
1403
+ Tutuf::VisualQuery::Metadata Exists (0.4ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
1404
+  (0.1ms) SAVEPOINT active_record_1
1405
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'query for results' LIMIT 1
1406
+ SQL (0.6ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:42:21 UTC +00:00], ["name", "query for results"], ["params", "{\"columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"all_columns\":[{\"rel_name\":\"people\",\"col_name\":\"name\",\"save_name\":\"name\"},{\"rel_name\":\"people\",\"col_name\":\"age\",\"save_name\":\"age\"}],\"relations\":[{\"rel_name\":\"people\",\"row\":0}],\"rows\":[0],\"query\":{\"name\":\"query for results\"}}"]]
1407
+  (0.8ms) CREATE VIEW "tutuf::visual_query"."query for results" AS SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
1408
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1409
+  (0.3ms) SELECT "people"."name" AS "name","people"."age" AS "age" FROM "people"
1410
+  (0.2ms) ROLLBACK
1411
+  (0.1ms) BEGIN
1412
+ ----------------------------------------------------------
1413
+ VisualQueryTest: test_validate_name_cannot_be_empty_string
1414
+ ----------------------------------------------------------
1415
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = '' LIMIT 1
1416
+  (0.1ms) ROLLBACK
1417
+  (0.1ms) BEGIN
1418
+ ----------------------------------------------------------------
1419
+ VisualQueryTest: test_validate_name_cannot_be_more_than_63_chars
1420
+ ----------------------------------------------------------------
1421
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz' LIMIT 1
1422
+  (0.2ms) ROLLBACK
1423
+  (0.1ms) BEGIN
1424
+ -------------------------------------------------
1425
+ VisualQueryTest: test_validate_name_cannot_be_nil
1426
+ -------------------------------------------------
1427
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" IS NULL LIMIT 1
1428
+  (0.1ms) ROLLBACK
1429
+  (0.1ms) BEGIN
1430
+ --------------------------------------------------
1431
+ VisualQueryTest: test_validate_name_must_be_unique
1432
+ --------------------------------------------------
1433
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'first' LIMIT 1
1434
+  (0.1ms) ROLLBACK
1435
+  (1.3ms) SELECT count(id) FROM tutuf_visual_query_metadata
1436
+ Unable to load categories_post, underlying cause No such file to load -- categories_post
1437
+
1438
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `load'
1439
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `block in load_file'
1440
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:616:in `new_constants_in'
1441
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:423:in `load_file'
1442
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:324:in `require_or_load'
1443
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:289:in `depend_on'
1444
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:207:in `require_dependency'
1445
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:773:in `try_to_load_dependency'
1446
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:792:in `block in require_fixture_classes'
1447
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `each'
1448
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `require_fixture_classes'
1449
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:768:in `fixtures'
1450
+ /Users/sava/code/visual_query/test/test_helper.rb:14:in `<class:TestCase>'
1451
+ /Users/sava/code/visual_query/test/test_helper.rb:8:in `<top (required)>'
1452
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
1453
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
1454
+ metadata_test.rb:2:in `<main>'
1455
+  (0.9ms) ALTER TABLE "categories" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" DISABLE TRIGGER ALL;ALTER TABLE "some_files" DISABLE TRIGGER ALL;ALTER TABLE "people" DISABLE TRIGGER ALL;ALTER TABLE "accounts" DISABLE TRIGGER ALL;ALTER TABLE "addresses" DISABLE TRIGGER ALL;ALTER TABLE "customers" DISABLE TRIGGER ALL;ALTER TABLE "orders" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "categories_posts" DISABLE TRIGGER ALL;ALTER TABLE "composite_pks" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "product_ins" DISABLE TRIGGER ALL;ALTER TABLE "product_outs" DISABLE TRIGGER ALL
1456
+  (0.1ms) BEGIN
1457
+ Fixture Delete (0.8ms) DELETE FROM "accounts"
1458
+ Fixture Insert (0.4ms) INSERT INTO "accounts" ("id", "name", "person_id") VALUES (1, 'jat', 1)
1459
+ Fixture Delete (0.4ms) DELETE FROM "categories"
1460
+ Fixture Insert (0.2ms) INSERT INTO "categories" ("id", "name") VALUES (1, 'first')
1461
+ Fixture Delete (0.3ms) DELETE FROM "categories_posts"
1462
+ Fixture Insert (0.2ms) INSERT INTO "categories_posts" ("category_id", "post_id") VALUES (1, 1)
1463
+ Fixture Delete (0.3ms) DELETE FROM "people"
1464
+ Fixture Insert (0.2ms) INSERT INTO "people" ("id", "name", "age") VALUES (1, 'John Atanasoff', 34)
1465
+ Fixture Insert (0.2ms) INSERT INTO "people" ("id", "name", "age") VALUES (2, 'Джон Атанасов', 34)
1466
+ Fixture Delete (0.2ms) DELETE FROM "posts"
1467
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("id", "title", "body") VALUES (1, 'First post!', 'Wankers like first post')
1468
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("id", "title", "body") VALUES (2, 'Màmìta Español', '')
1469
+ Fixture Delete (0.2ms) DELETE FROM "product_ins"
1470
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (1, 1, 23, 7)
1471
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (2, 1, 14, 10)
1472
+ Fixture Insert (0.2ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (3, 2, 67, 25)
1473
+ Fixture Delete (0.3ms) DELETE FROM "product_outs"
1474
+ Fixture Insert (0.1ms) INSERT INTO "product_outs" ("id", "product_id", "quantity", "sale_price") VALUES (1, 1, 45, 10)
1475
+ Fixture Delete (0.2ms) DELETE FROM "products"
1476
+ Fixture Insert (0.1ms) INSERT INTO "products" ("id", "name") VALUES (1, 'pencil')
1477
+ Fixture Insert (0.1ms) INSERT INTO "products" ("id", "name") VALUES (2, 'bottle')
1478
+  (3.1ms) COMMIT
1479
+  (0.7ms) ALTER TABLE "categories" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" ENABLE TRIGGER ALL;ALTER TABLE "some_files" ENABLE TRIGGER ALL;ALTER TABLE "people" ENABLE TRIGGER ALL;ALTER TABLE "accounts" ENABLE TRIGGER ALL;ALTER TABLE "addresses" ENABLE TRIGGER ALL;ALTER TABLE "customers" ENABLE TRIGGER ALL;ALTER TABLE "orders" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "categories_posts" ENABLE TRIGGER ALL;ALTER TABLE "composite_pks" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "product_ins" ENABLE TRIGGER ALL;ALTER TABLE "product_outs" ENABLE TRIGGER ALL
1480
+  (0.2ms) BEGIN
1481
+ -----------------------------------------------------------------
1482
+ MetadataTest: test_params_serialize_to_json_without_escaping_utf8
1483
+ -----------------------------------------------------------------
1484
+ Tutuf::VisualQuery::Metadata Exists (0.8ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'params_serialization' LIMIT 1
1485
+  (0.1ms) SAVEPOINT active_record_1
1486
+ Tutuf::VisualQuery::Metadata Exists (0.2ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'params_serialization' LIMIT 1
1487
+ SQL (1.7ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:42:27 UTC +00:00], ["name", "params_serialization"], ["params", "{\"sql\":\"SELECT AVG(age) AS \\\"възраст\\\" FROM people\",\"query\":{\"name\":\"params_serialization\"}}"]]
1488
+  (1.2ms) CREATE VIEW "tutuf::visual_query"."params_serialization" AS SELECT AVG(age) AS "възраст" FROM people
1489
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1490
+  (0.3ms) SELECT params FROM tutuf_visual_query_metadata WHERE name='params_serialization'
1491
+  (0.1ms) ROLLBACK
1492
+  (2.3ms) SELECT count(id) FROM tutuf_visual_query_metadata
1493
+ Unable to load categories_post, underlying cause No such file to load -- categories_post
1494
+
1495
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `load'
1496
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:424:in `block in load_file'
1497
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:616:in `new_constants_in'
1498
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:423:in `load_file'
1499
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:324:in `require_or_load'
1500
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:289:in `depend_on'
1501
+ /Users/sava/.gem/ruby/2.2.6/gems/activesupport-4.0.13/lib/active_support/dependencies.rb:207:in `require_dependency'
1502
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:773:in `try_to_load_dependency'
1503
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:792:in `block in require_fixture_classes'
1504
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `each'
1505
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:790:in `require_fixture_classes'
1506
+ /Users/sava/.gem/ruby/2.2.6/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:768:in `fixtures'
1507
+ /Users/sava/code/visual_query/test/test_helper.rb:14:in `<class:TestCase>'
1508
+ /Users/sava/code/visual_query/test/test_helper.rb:8:in `<top (required)>'
1509
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
1510
+ /Users/sava/.rubies/ruby-2.2.6/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
1511
+ metadata_test.rb:2:in `<main>'
1512
+  (0.9ms) ALTER TABLE "categories" DISABLE TRIGGER ALL;ALTER TABLE "schema_migrations" DISABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" DISABLE TRIGGER ALL;ALTER TABLE "some_files" DISABLE TRIGGER ALL;ALTER TABLE "people" DISABLE TRIGGER ALL;ALTER TABLE "accounts" DISABLE TRIGGER ALL;ALTER TABLE "addresses" DISABLE TRIGGER ALL;ALTER TABLE "customers" DISABLE TRIGGER ALL;ALTER TABLE "orders" DISABLE TRIGGER ALL;ALTER TABLE "posts" DISABLE TRIGGER ALL;ALTER TABLE "categories_posts" DISABLE TRIGGER ALL;ALTER TABLE "composite_pks" DISABLE TRIGGER ALL;ALTER TABLE "products" DISABLE TRIGGER ALL;ALTER TABLE "product_ins" DISABLE TRIGGER ALL;ALTER TABLE "product_outs" DISABLE TRIGGER ALL
1513
+  (0.1ms) BEGIN
1514
+ Fixture Delete (0.9ms) DELETE FROM "accounts"
1515
+ Fixture Insert (0.3ms) INSERT INTO "accounts" ("id", "name", "person_id") VALUES (1, 'jat', 1)
1516
+ Fixture Delete (0.3ms) DELETE FROM "categories"
1517
+ Fixture Insert (0.2ms) INSERT INTO "categories" ("id", "name") VALUES (1, 'first')
1518
+ Fixture Delete (0.2ms) DELETE FROM "categories_posts"
1519
+ Fixture Insert (0.1ms) INSERT INTO "categories_posts" ("category_id", "post_id") VALUES (1, 1)
1520
+ Fixture Delete (0.2ms) DELETE FROM "people"
1521
+ Fixture Insert (0.2ms) INSERT INTO "people" ("id", "name", "age") VALUES (1, 'John Atanasoff', 34)
1522
+ Fixture Insert (0.4ms) INSERT INTO "people" ("id", "name", "age") VALUES (2, 'Джон Атанасов', 34)
1523
+ Fixture Delete (0.3ms) DELETE FROM "posts"
1524
+ Fixture Insert (0.2ms) INSERT INTO "posts" ("id", "title", "body") VALUES (1, 'First post!', 'Wankers like first post')
1525
+ Fixture Insert (0.1ms) INSERT INTO "posts" ("id", "title", "body") VALUES (2, 'Màmìta Español', '')
1526
+ Fixture Delete (0.3ms) DELETE FROM "product_ins"
1527
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (1, 1, 23, 7)
1528
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (2, 1, 14, 10)
1529
+ Fixture Insert (0.1ms) INSERT INTO "product_ins" ("id", "product_id", "quantity", "buy_price") VALUES (3, 2, 67, 25)
1530
+ Fixture Delete (0.2ms) DELETE FROM "product_outs"
1531
+ Fixture Insert (0.1ms) INSERT INTO "product_outs" ("id", "product_id", "quantity", "sale_price") VALUES (1, 1, 45, 10)
1532
+ Fixture Delete (0.3ms) DELETE FROM "products"
1533
+ Fixture Insert (0.2ms) INSERT INTO "products" ("id", "name") VALUES (1, 'pencil')
1534
+ Fixture Insert (0.1ms) INSERT INTO "products" ("id", "name") VALUES (2, 'bottle')
1535
+  (1.9ms) COMMIT
1536
+  (0.3ms) ALTER TABLE "categories" ENABLE TRIGGER ALL;ALTER TABLE "schema_migrations" ENABLE TRIGGER ALL;ALTER TABLE "tutuf_visual_query_metadata" ENABLE TRIGGER ALL;ALTER TABLE "some_files" ENABLE TRIGGER ALL;ALTER TABLE "people" ENABLE TRIGGER ALL;ALTER TABLE "accounts" ENABLE TRIGGER ALL;ALTER TABLE "addresses" ENABLE TRIGGER ALL;ALTER TABLE "customers" ENABLE TRIGGER ALL;ALTER TABLE "orders" ENABLE TRIGGER ALL;ALTER TABLE "posts" ENABLE TRIGGER ALL;ALTER TABLE "categories_posts" ENABLE TRIGGER ALL;ALTER TABLE "composite_pks" ENABLE TRIGGER ALL;ALTER TABLE "products" ENABLE TRIGGER ALL;ALTER TABLE "product_ins" ENABLE TRIGGER ALL;ALTER TABLE "product_outs" ENABLE TRIGGER ALL
1537
+  (0.1ms) BEGIN
1538
+ -----------------------------------------------------------------
1539
+ MetadataTest: test_params_serialize_to_json_without_escaping_utf8
1540
+ -----------------------------------------------------------------
1541
+ Tutuf::VisualQuery::Metadata Exists (0.7ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'params_serialization' LIMIT 1
1542
+  (0.2ms) SAVEPOINT active_record_1
1543
+ Tutuf::VisualQuery::Metadata Exists (0.3ms) SELECT 1 AS one FROM "tutuf_visual_query_metadata" WHERE "tutuf_visual_query_metadata"."name" = 'params_serialization' LIMIT 1
1544
+ SQL (1.3ms) INSERT INTO "tutuf_visual_query_metadata" ("created_at", "name", "params") VALUES ($1, $2, $3) RETURNING "id" [["created_at", Fri, 03 Feb 2017 14:42:35 UTC +00:00], ["name", "params_serialization"], ["params", "{\"sql\":\"SELECT AVG(age) AS \\\"възраст\\\" FROM people\",\"query\":{\"name\":\"params_serialization\"}}"]]
1545
+  (1.1ms) CREATE VIEW "tutuf::visual_query"."params_serialization" AS SELECT AVG(age) AS "възраст" FROM people
1546
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1547
+  (0.2ms) SELECT params FROM tutuf_visual_query_metadata WHERE name='params_serialization'
1548
+  (0.1ms) ROLLBACK