arel_extensions 2.1.3 → 2.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +1 -2
  3. data/.github/workflows/ruby.yml +4 -4
  4. data/.rubocop.yml +25 -1
  5. data/Gemfile +10 -10
  6. data/README.md +1 -2
  7. data/Rakefile +4 -4
  8. data/TODO +0 -1
  9. data/arel_extensions.gemspec +11 -11
  10. data/gemfiles/rails3.gemfile +10 -10
  11. data/gemfiles/rails4.gemfile +13 -13
  12. data/gemfiles/rails5_0.gemfile +12 -12
  13. data/gemfiles/rails5_1_4.gemfile +12 -12
  14. data/gemfiles/rails5_2.gemfile +13 -13
  15. data/gemfiles/rails6.gemfile +11 -11
  16. data/gemfiles/rails6_1.gemfile +11 -11
  17. data/gemfiles/rails7.gemfile +7 -7
  18. data/gemspecs/arel_extensions-v1.gemspec +12 -12
  19. data/gemspecs/arel_extensions-v2.gemspec +11 -11
  20. data/init/mssql.sql +0 -0
  21. data/init/mysql.sql +0 -0
  22. data/init/oracle.sql +0 -0
  23. data/init/postgresql.sql +0 -0
  24. data/init/sqlite.sql +0 -0
  25. data/lib/arel_extensions/attributes.rb +2 -2
  26. data/lib/arel_extensions/boolean_functions.rb +2 -4
  27. data/lib/arel_extensions/common_sql_functions.rb +10 -10
  28. data/lib/arel_extensions/comparators.rb +14 -14
  29. data/lib/arel_extensions/date_duration.rb +7 -7
  30. data/lib/arel_extensions/helpers.rb +16 -13
  31. data/lib/arel_extensions/insert_manager.rb +1 -1
  32. data/lib/arel_extensions/math.rb +16 -18
  33. data/lib/arel_extensions/math_functions.rb +18 -18
  34. data/lib/arel_extensions/nodes/abs.rb +0 -0
  35. data/lib/arel_extensions/nodes/aggregate_function.rb +0 -0
  36. data/lib/arel_extensions/nodes/blank.rb +1 -1
  37. data/lib/arel_extensions/nodes/case.rb +4 -6
  38. data/lib/arel_extensions/nodes/cast.rb +3 -3
  39. data/lib/arel_extensions/nodes/ceil.rb +0 -0
  40. data/lib/arel_extensions/nodes/change_case.rb +0 -0
  41. data/lib/arel_extensions/nodes/coalesce.rb +0 -0
  42. data/lib/arel_extensions/nodes/collate.rb +9 -9
  43. data/lib/arel_extensions/nodes/concat.rb +2 -2
  44. data/lib/arel_extensions/nodes/date_diff.rb +6 -6
  45. data/lib/arel_extensions/nodes/duration.rb +0 -0
  46. data/lib/arel_extensions/nodes/find_in_set.rb +0 -0
  47. data/lib/arel_extensions/nodes/floor.rb +0 -0
  48. data/lib/arel_extensions/nodes/format.rb +0 -0
  49. data/lib/arel_extensions/nodes/formatted_number.rb +2 -2
  50. data/lib/arel_extensions/nodes/function.rb +21 -21
  51. data/lib/arel_extensions/nodes/is_null.rb +0 -0
  52. data/lib/arel_extensions/nodes/json.rb +7 -7
  53. data/lib/arel_extensions/nodes/length.rb +0 -0
  54. data/lib/arel_extensions/nodes/levenshtein_distance.rb +1 -1
  55. data/lib/arel_extensions/nodes/locate.rb +0 -0
  56. data/lib/arel_extensions/nodes/log10.rb +0 -0
  57. data/lib/arel_extensions/nodes/matches.rb +1 -1
  58. data/lib/arel_extensions/nodes/md5.rb +0 -0
  59. data/lib/arel_extensions/nodes/power.rb +0 -0
  60. data/lib/arel_extensions/nodes/rand.rb +0 -0
  61. data/lib/arel_extensions/nodes/repeat.rb +0 -0
  62. data/lib/arel_extensions/nodes/replace.rb +2 -2
  63. data/lib/arel_extensions/nodes/round.rb +0 -0
  64. data/lib/arel_extensions/nodes/soundex.rb +2 -2
  65. data/lib/arel_extensions/nodes/std.rb +0 -0
  66. data/lib/arel_extensions/nodes/substring.rb +0 -0
  67. data/lib/arel_extensions/nodes/sum.rb +0 -0
  68. data/lib/arel_extensions/nodes/then.rb +0 -0
  69. data/lib/arel_extensions/nodes/trim.rb +0 -0
  70. data/lib/arel_extensions/nodes/union.rb +4 -4
  71. data/lib/arel_extensions/nodes/union_all.rb +3 -3
  72. data/lib/arel_extensions/nodes/wday.rb +0 -0
  73. data/lib/arel_extensions/nodes.rb +0 -0
  74. data/lib/arel_extensions/null_functions.rb +0 -0
  75. data/lib/arel_extensions/predications.rb +10 -10
  76. data/lib/arel_extensions/railtie.rb +1 -1
  77. data/lib/arel_extensions/set_functions.rb +3 -3
  78. data/lib/arel_extensions/string_functions.rb +8 -8
  79. data/lib/arel_extensions/tasks.rb +2 -2
  80. data/lib/arel_extensions/version.rb +1 -1
  81. data/lib/arel_extensions/visitors/convert_format.rb +0 -0
  82. data/lib/arel_extensions/visitors/ibm_db.rb +19 -19
  83. data/lib/arel_extensions/visitors/mssql.rb +127 -121
  84. data/lib/arel_extensions/visitors/mysql.rb +137 -145
  85. data/lib/arel_extensions/visitors/oracle.rb +128 -128
  86. data/lib/arel_extensions/visitors/oracle12.rb +16 -16
  87. data/lib/arel_extensions/visitors/postgresql.rb +139 -137
  88. data/lib/arel_extensions/visitors/sqlite.rb +83 -85
  89. data/lib/arel_extensions/visitors/to_sql.rb +143 -148
  90. data/lib/arel_extensions/visitors.rb +7 -7
  91. data/lib/arel_extensions.rb +46 -32
  92. data/test/arelx_test_helper.rb +14 -13
  93. data/test/database.yml +5 -5
  94. data/test/real_db_test.rb +78 -78
  95. data/test/support/fake_record.rb +1 -1
  96. data/test/test_comparators.rb +5 -5
  97. data/test/visitors/test_bulk_insert_oracle.rb +4 -4
  98. data/test/visitors/test_bulk_insert_sqlite.rb +4 -4
  99. data/test/visitors/test_bulk_insert_to_sql.rb +4 -4
  100. data/test/visitors/test_oracle.rb +14 -14
  101. data/test/visitors/test_to_sql.rb +82 -82
  102. data/test/with_ar/all_agnostic_test.rb +364 -299
  103. data/test/with_ar/insert_agnostic_test.rb +17 -14
  104. data/test/with_ar/test_bulk_sqlite.rb +4 -4
  105. data/test/with_ar/test_math_sqlite.rb +12 -12
  106. data/test/with_ar/test_string_mysql.rb +20 -20
  107. data/test/with_ar/test_string_sqlite.rb +20 -20
  108. data/version_v1.rb +1 -1
  109. data/version_v2.rb +1 -1
  110. metadata +2 -9
  111. data/.travis/oracle/download.js +0 -152
  112. data/.travis/oracle/download.sh +0 -30
  113. data/.travis/oracle/download_ojdbc.js +0 -116
  114. data/.travis/oracle/install.sh +0 -34
  115. data/.travis/setup_accounts.sh +0 -9
  116. data/.travis/sqlite3/extension-functions.sh +0 -6
  117. data/.travis.yml +0 -193
@@ -1,9 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -ev
4
-
5
- "$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
6
- @@test/support/alter_system_user_password.sql
7
- @@test/support/create_oracle_enhanced_users.sql
8
- exit
9
- SQL
@@ -1,6 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -ex
4
-
5
- sudo curl -L https://sqlite.org/contrib/download/extension-functions.c?get=25 -o /tmp/extension-functions.c
6
- sudo gcc -fPIC -lm -shared /tmp/extension-functions.c -o /usr/lib/sqlite3/extension-functions.so
data/.travis.yml DELETED
@@ -1,193 +0,0 @@
1
- language: ruby
2
- sudo: required
3
- dist: trusty
4
- cache:
5
- bundler: true
6
- directories:
7
- - $ORACLE_HOME
8
- before_install:
9
- - chmod +x .travis/sqlite3/extension-functions.sh
10
- # - chmod +x .travis/oracle/download.sh
11
- # - chmod +x .travis/oracle/install.sh
12
- # - chmod +x .travis/setup_accounts.sh
13
- - sudo apt-get install -y sqlite3-pcre curl
14
- - .travis/sqlite3/extension-functions.sh
15
- # - .travis/oracle/download.sh
16
- # - sh -ex .travis/oracle/install.sh
17
- # - .travis/setup_accounts.sh
18
- install:
19
- - bundle install
20
- gemfile:
21
- - gemfiles/rails4.gemfile
22
- - gemfiles/rails5_0.gemfile
23
- - gemfiles/rails5_1_4.gemfile
24
- - gemfiles/rails5_2.gemfile
25
- - gemfiles/rails6.gemfile
26
- services:
27
- - mysql
28
- - postgresql
29
- addons:
30
- postgresql: '9.4'
31
- before_script:
32
- - mysql -e 'create database arext_test;'
33
- - psql -c 'create database arext_test;' -U postgres
34
- script:
35
- - ./generate_gems.sh
36
- - bundle exec rake test
37
- - bundle exec rake test:sqlite
38
- - bundle exec rake test:mysql
39
- - bundle exec rake test:postgresql
40
- #- bundle exec rake test:oracle # service unavailable
41
- env:
42
- global:
43
- - JRUBY_OPTS='--dev -J-Xmx1024M'
44
- # - ORACLE_COOKIE=sqldev
45
- # - ORACLE_FILE=oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip
46
- # - ORACLE_OJDBC_URL=http://download.oracle.com/otn/utilities_drivers/jdbc/11204/ojdbc6.jar
47
- - TNS_ADMIN=$ORACLE_HOME/network/admin
48
- # - ORACLE_BASE=/u01/app/oracle
49
- # - ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
50
- # - ORACLE_SID=XE
51
- - DATABASE_NAME=XE
52
- - NLS_LANG=AMERICAN_AMERICA.AL32UTF8
53
- - secure: 0RUuF4l0e3J8UIIMlgb8x/aYy2pH6Wb+EWylOr2W1EQechivoFw6IEYD1EZWIOZ/uNpkQ2h/urbUqW3/HpKhZn+NYP2sQI41Xyu1TD+6HPWAHpEvLzemhQSJV6eIeLRQoVDLUmqF23nUZDtKQAwOOyJVMeqHMahJi5K7N/cfQmifs2QcBnMxPnANIcrSXxOCBoqCl6BERG9JTeKERG/lWG1I9vRIe9ISNyOPUQVVI6SfTJwhJP5NLkxSJG1q2PLPK7p6zQ684sS4zSnS5oV23yDsQWWIwxk78CVu1jnFBu8Qq3ngWsInlkHrPotjtaxmTxM8JQd4fgE5NMO2Pjnj8w7zg+sbl+3OVtareX+M9+OLdUD5xBQhecPpzflMqib2qZ0fr9tdoT8kAZJTiXtQrptZfaXleZlH74l2dO/PYxkoWMusYQnSbQl0G3AoyYH+l7YpefL4arm0s5IIiOK+ZiCoZ14pl26rYAA1iPUe5AT+hecKi+fwqhyFE7fMX+zC+AvzsQL8jrP0CXL/hmPkoFYxvcDgUoYhvOq+mmQHdOfU7ny4hH5z5d9691qceduHFvF7fNZ4pSofj03eGqfTTk+SDNeZIo6NXNlayayjV2L/DxL6d7vetxkWwipx47PI76gBAqJlxgODJuzoOtyQkPyIVsDlzI1UPoS+UbrU51w=
54
- rvm:
55
- - 2.0.0
56
- - 2.1
57
- - 2.2.5
58
- - 2.3.1
59
- - 2.4.0
60
- - 2.5.0
61
- - 2.7.1
62
- - jruby-9.0.5.0
63
- - jruby-9.2.11.1
64
- - jruby-head
65
- jdk:
66
- - oraclejdk8
67
- - oraclejdk9
68
- - openjdk10
69
- - openjdk11
70
- - oraclejdk11
71
- matrix:
72
- fast_finish: true
73
- exclude:
74
- - rvm: 2.0.0
75
- jdk: oraclejdk9
76
- - rvm: 2.1
77
- jdk: oraclejdk9
78
- - rvm: 2.2.5
79
- jdk: oraclejdk9
80
- - rvm: 2.3.1
81
- jdk: oraclejdk9
82
- - rvm: 2.4.0
83
- jdk: oraclejdk9
84
- - rvm: 2.5.0
85
- jdk: oraclejdk9
86
- - rvm: 2.7.1
87
- jdk: oraclejdk9
88
- - rvm: 2.0.0
89
- jdk: openjdk10
90
- - rvm: 2.1
91
- jdk: openjdk10
92
- - rvm: 2.2.5
93
- jdk: openjdk10
94
- - rvm: 2.3.1
95
- jdk: openjdk10
96
- - rvm: 2.4.0
97
- jdk: openjdk10
98
- - rvm: 2.5.0
99
- jdk: openjdk10
100
- - rvm: 2.7.1
101
- jdk: openjdk10
102
- - rvm: 2.0.0
103
- jdk: oraclejdk11
104
- - rvm: 2.1
105
- jdk: oraclejdk11
106
- - rvm: 2.2.5
107
- jdk: oraclejdk11
108
- - rvm: 2.3.1
109
- jdk: oraclejdk11
110
- - rvm: 2.4.0
111
- jdk: oraclejdk11
112
- - rvm: 2.5.0
113
- jdk: oraclejdk11
114
- - rvm: 2.7.1
115
- jdk: oraclejdk11
116
- - rvm: 2.0.0
117
- jdk: openjdk11
118
- - rvm: 2.1
119
- jdk: openjdk11
120
- - rvm: 2.2.5
121
- jdk: openjdk11
122
- - rvm: 2.3.1
123
- jdk: openjdk11
124
- - rvm: 2.4.0
125
- jdk: openjdk11
126
- - rvm: 2.5.0
127
- jdk: openjdk11
128
- - rvm: 2.7.1
129
- jdk: openjdk11
130
- - rvm: 2.7.1
131
- gemfile: gemfiles/rails4.gemfile
132
- - rvm : jruby-9.0.5.0
133
- gemfile: gemfiles/rails4.gemfile
134
- - rvm : jruby-9.2.11.1
135
- gemfile: gemfiles/rails4.gemfile
136
- - rvm: 2.0.0
137
- gemfile: gemfiles/rails5_0.gemfile
138
- - rvm: 2.1
139
- gemfile: gemfiles/rails5_0.gemfile
140
- - rvm: 2.7.1
141
- gemfile: gemfiles/rails5.0.gemfile
142
- - rvm: 2.0.0
143
- gemfile: gemfiles/rails5_1_4.gemfile
144
- - rvm: 2.1
145
- gemfile: gemfiles/rails5_1_4.gemfile
146
- - rvm: 2.2.5
147
- gemfile: gemfiles/rails5_1_4.gemfile
148
- - rvm: 2.7.1
149
- gemfile: gemfiles/rails5.1.4.gemfile
150
- - rvm: 2.7.1
151
- gemfile: gemfiles/rails5.1.4.gemfile
152
- - rvm: 2.0.0
153
- gemfile: gemfiles/rails5_2.gemfile
154
- - rvm: 2.1
155
- gemfile: gemfiles/rails5_2.gemfile
156
- - rvm: 2.2.5
157
- gemfile: gemfiles/rails5_2.gemfile
158
- - rvm: 2.7.1
159
- gemfile: gemfiles/rails5.2.gemfile
160
- - rvm: 2.0.0
161
- gemfile: gemfiles/rails6.gemfile
162
- - rvm: 2.1
163
- gemfile: gemfiles/rails6.gemfile
164
- - rvm: 2.2.5
165
- gemfile: gemfiles/rails6.gemfile
166
- - rvm: 2.3.1
167
- gemfile: gemfiles/rails6.gemfile
168
- - rvm: 2.4.0
169
- gemfile: gemfiles/rails6.gemfile
170
- allow_failures:
171
- - rvm: jruby-9.0.5.0
172
- gemfile: gemfiles/rails5_1_4.gemfile
173
- - rvm: jruby-9.0.5.0
174
- gemfile: gemfiles/rails5_2.gemfile
175
- - rvm: jruby-9.2.11.1
176
- jdk: oraclejdk9
177
- gemfile: gemfiles/rails5_2.gemfile
178
- - jdk: oraclejdk9
179
- - jdk: openjdk10
180
- - jdk: openjdk11
181
- - jdk: oraclejdk11
182
- - rvm: jruby-head
183
- - rvm: jruby-9.2.11.1
184
- jdk: oraclejdk9
185
- - rvm: jruby-9.0.5.0
186
- jdk: oraclejdk9
187
- - rvm: 2.7.1
188
- - gemfile: gemfiles/rails6.gemfile
189
- bundler_args: "--jobs 3 --retry 2"
190
- notifications:
191
- email:
192
- - julien.delporte@faveod.com
193
- - yann.azoury@faveod.com