db2_query 0.3.2 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +127 -34
- data/Rakefile +1 -11
- data/lib/db2_query/base.rb +0 -1
- data/lib/db2_query/core.rb +33 -20
- data/lib/db2_query/db_connection.rb +4 -4
- data/lib/db2_query/definitions.rb +24 -4
- data/lib/db2_query/error.rb +13 -1
- data/lib/db2_query/helper.rb +6 -5
- data/lib/db2_query/logger.rb +1 -1
- data/lib/db2_query/query.rb +30 -16
- data/lib/db2_query/railtie.rb +0 -14
- data/lib/db2_query/version.rb +1 -3
- data/lib/db2_query.rb +3 -8
- data/lib/tasks/db2_query_tasks.rake +4 -0
- metadata +26 -86
- data/lib/db2_query/quoting.rb +0 -102
- data/lib/db2_query/tasks/database.rake +0 -10
- data/lib/db2_query/tasks/init.rake +0 -9
- data/lib/db2_query/tasks/initializer.rake +0 -10
- data/lib/db2_query/tasks/templates/database.rb.tt +0 -19
- data/lib/db2_query/tasks/templates/initializer.rb.tt +0 -8
- data/lib/rails/generators/query/USAGE +0 -15
- data/lib/rails/generators/query/query_generator.rb +0 -70
- data/lib/rails/generators/query/templates/query.rb.tt +0 -26
- data/lib/rails/generators/query/templates/query_definitions.rb.tt +0 -12
- data/lib/rails/generators/query/templates/unit_test.rb.tt +0 -9
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
<% module_namespacing do -%>
|
4
|
-
class <%= query_class_name %> < <%= "Db2Query::Base" -%>
|
5
|
-
<% if @query_methods.empty? %>
|
6
|
-
<%= indent("query :to_do, <<-SQL\n") %>
|
7
|
-
<%= indent("SQL\n") %>
|
8
|
-
<%= indent("def to_do_sql\n") %>
|
9
|
-
<%= indent("end") %>
|
10
|
-
<% end -%>
|
11
|
-
<% @method_options.each do |key, val| -%>
|
12
|
-
<% val.each_with_index do |option, index| -%>
|
13
|
-
<% case key when 'defines' -%>
|
14
|
-
<%= indent("def #{option}_sql\n") %>
|
15
|
-
<%= indent("end") %>
|
16
|
-
<% when 'queries' %>
|
17
|
-
<%= indent("query :#{option}, <<-SQL\n") %>
|
18
|
-
<%= indent("SQL") %>
|
19
|
-
<% when 'lambdas' %>
|
20
|
-
<%= indent("query :#{option}, -> args {\n") %>
|
21
|
-
<%= indent("}") %>
|
22
|
-
<% end -%>
|
23
|
-
<% end -%>
|
24
|
-
<% end -%>
|
25
|
-
<%= 'end' -%>
|
26
|
-
<% end %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
<% module_definitions_namespacing do -%>
|
4
|
-
class <%= query_class_name %>Definitions < <%= "Db2Query::Definitions" %>
|
5
|
-
<%= indent("def describe") -%>
|
6
|
-
<% @query_methods.each do |method| %>
|
7
|
-
<%= indent("query_definition :#{method} do |c|\n") %>
|
8
|
-
<%= indent("end") %>
|
9
|
-
<% end -%>
|
10
|
-
<%= indent("end") %>
|
11
|
-
<%= 'end' -%>
|
12
|
-
<% end %>
|