activerecord-ingres-adapter 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,2 @@
1
+ require 'arel/visitors/ingres'
2
+ require 'active_record/connection_adapters/ingres_adapter'
@@ -0,0 +1,30 @@
1
+ module Arel
2
+ module Visitors
3
+ class Ingres < Arel::Visitors::ToSql
4
+ private
5
+ def visit_Arel_Nodes_SelectStatement o
6
+ [
7
+ "SELECT",
8
+ (visit(o.limit) if o.limit),
9
+ o.cores.map { |x| visit_Arel_Nodes_SelectCore x }.join,
10
+ ("ORDER BY #{o.orders.map { |x| visit x}.join(', ')}" unless o.orders.empty?),
11
+ (visit(o.offset) if o.offset),
12
+ ].compact.join ' '
13
+ end
14
+
15
+ def visit_Arel_Nodes_SelectCore o
16
+ [
17
+ "#{o.projections.map { |x| visit x }.join ', '}",
18
+ ("FROM #{visit(o.source)}" if o.source && !o.source.empty?),
19
+ ("WHERE #{o.wheres.map { |x| visit x }.join ' AND ' }" unless o.wheres.empty?),
20
+ ("GROUP BY #{o.groups.map { |x| visit x }.join ', ' }" unless o.groups.empty?),
21
+ (visit(o.having) if o.having),
22
+ ].compact.join ' '
23
+ end
24
+
25
+ def visit_Arel_Nodes_Limit o
26
+ "FIRST #{visit o.expr}"
27
+ end
28
+ end
29
+ end
30
+ end
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: activerecord-ingres-adapter
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Grant Croker
8
+ - Bruce Lunsford
9
+ - Jared Richardson
10
+ - Felix Bellanger
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+ date: 2014-10-14 00:00:00.000000000 Z
15
+ dependencies: []
16
+ description: ActiveRecord Ingres Adapter and driver for the Ingres Enterprise Relational
17
+ Database
18
+ email: felix.bellanger@gmail.com
19
+ executables: []
20
+ extensions:
21
+ - ext/extconf.rb
22
+ extra_rdoc_files: []
23
+ files:
24
+ - CHANGELOG
25
+ - Gemfile
26
+ - LICENSE
27
+ - README.md
28
+ - Rakefile
29
+ - activerecord_ingres_adapter.gemspec
30
+ - ext/Ingres.c
31
+ - ext/Ingres.h
32
+ - ext/Unicode.c
33
+ - ext/Unicode.h
34
+ - ext/createMake.bat
35
+ - ext/extconf.rb
36
+ - ext/tests/config.rb
37
+ - ext/tests/tc_connect.rb
38
+ - ext/tests/tc_connect_hash.rb
39
+ - ext/tests/tc_connect_with_login_only.rb
40
+ - ext/tests/tc_connect_with_login_password.rb
41
+ - ext/tests/tc_dual_connections.rb
42
+ - ext/tests/tc_env_date_format.rb
43
+ - ext/tests/tc_query_simple.rb
44
+ - ext/tests/tc_query_username.rb
45
+ - ext/tests/tc_transactions_savepoint.rb
46
+ - ext/tests/tc_type_date_fetch.rb
47
+ - ext/tests/tc_type_lob_fetch.rb
48
+ - ext/tests/ts_all.rb
49
+ - ext/tests/ts_connect.rb
50
+ - ext/tests/ts_environment.rb
51
+ - ext/tests/ts_execute.rb
52
+ - ext/tests/ts_transactions.rb
53
+ - ext/tests/ts_types.rb
54
+ - lib/active_record/connection_adapters/ingres_adapter.rb
55
+ - lib/activerecord-ingres-adapter.rb
56
+ - lib/arel/visitors/ingres.rb
57
+ homepage: https://github.com/Keeguon/activerecord-ingres-adapter
58
+ licenses: []
59
+ metadata: {}
60
+ post_install_message:
61
+ rdoc_options: []
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ requirements: []
75
+ rubyforge_project: activerecord-ingres-adapter
76
+ rubygems_version: 2.4.2
77
+ signing_key:
78
+ specification_version: 4
79
+ summary: ActiveRecord Ingres Adapter
80
+ test_files: []