arel_extensions 1.3.2 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -2
- data/.github/workflows/ruby.yml +43 -91
- data/.gitignore +7 -6
- data/.rubocop.yml +62 -1
- data/Gemfile +11 -11
- data/README.md +1 -1
- data/Rakefile +4 -4
- data/TODO +0 -1
- data/appveyor.yml +73 -0
- data/arel_extensions.gemspec +12 -12
- data/gemfiles/rails3.gemfile +10 -10
- data/gemfiles/rails4.gemfile +14 -14
- data/gemfiles/rails5_0.gemfile +13 -13
- data/gemfiles/rails5_1_4.gemfile +13 -13
- data/gemfiles/rails5_2.gemfile +15 -14
- data/gemfiles/rails6.gemfile +13 -12
- data/gemfiles/rails6_1.gemfile +13 -12
- data/gemfiles/rails7.gemfile +9 -8
- data/gemspecs/arel_extensions-v1.gemspec +12 -12
- data/gemspecs/arel_extensions-v2.gemspec +11 -11
- data/init/mssql.sql +0 -0
- data/init/mysql.sql +0 -0
- data/init/oracle.sql +0 -0
- data/init/postgresql.sql +0 -0
- data/init/sqlite.sql +0 -0
- data/lib/arel_extensions/attributes.rb +2 -2
- data/lib/arel_extensions/boolean_functions.rb +2 -4
- data/lib/arel_extensions/common_sql_functions.rb +12 -12
- data/lib/arel_extensions/comparators.rb +14 -14
- data/lib/arel_extensions/date_duration.rb +7 -7
- data/lib/arel_extensions/helpers.rb +19 -16
- data/lib/arel_extensions/insert_manager.rb +1 -1
- data/lib/arel_extensions/math.rb +44 -31
- data/lib/arel_extensions/math_functions.rb +18 -18
- data/lib/arel_extensions/nodes/abs.rb +0 -0
- data/lib/arel_extensions/nodes/aggregate_function.rb +0 -0
- data/lib/arel_extensions/nodes/blank.rb +1 -1
- data/lib/arel_extensions/nodes/case.rb +4 -6
- data/lib/arel_extensions/nodes/cast.rb +5 -5
- data/lib/arel_extensions/nodes/ceil.rb +0 -0
- data/lib/arel_extensions/nodes/change_case.rb +0 -0
- data/lib/arel_extensions/nodes/coalesce.rb +1 -1
- data/lib/arel_extensions/nodes/collate.rb +9 -9
- data/lib/arel_extensions/nodes/concat.rb +2 -2
- data/lib/arel_extensions/nodes/date_diff.rb +10 -10
- data/lib/arel_extensions/nodes/duration.rb +0 -0
- data/lib/arel_extensions/nodes/find_in_set.rb +0 -0
- data/lib/arel_extensions/nodes/floor.rb +0 -0
- data/lib/arel_extensions/nodes/format.rb +0 -0
- data/lib/arel_extensions/nodes/formatted_number.rb +2 -2
- data/lib/arel_extensions/nodes/function.rb +21 -21
- data/lib/arel_extensions/nodes/is_null.rb +0 -0
- data/lib/arel_extensions/nodes/json.rb +7 -7
- data/lib/arel_extensions/nodes/length.rb +0 -0
- data/lib/arel_extensions/nodes/levenshtein_distance.rb +1 -1
- data/lib/arel_extensions/nodes/locate.rb +1 -1
- data/lib/arel_extensions/nodes/log10.rb +0 -0
- data/lib/arel_extensions/nodes/matches.rb +1 -1
- data/lib/arel_extensions/nodes/md5.rb +0 -0
- data/lib/arel_extensions/nodes/power.rb +0 -0
- data/lib/arel_extensions/nodes/rand.rb +0 -0
- data/lib/arel_extensions/nodes/repeat.rb +2 -2
- data/lib/arel_extensions/nodes/replace.rb +2 -2
- data/lib/arel_extensions/nodes/round.rb +0 -0
- data/lib/arel_extensions/nodes/soundex.rb +2 -2
- data/lib/arel_extensions/nodes/std.rb +0 -0
- data/lib/arel_extensions/nodes/substring.rb +1 -1
- data/lib/arel_extensions/nodes/sum.rb +0 -0
- data/lib/arel_extensions/nodes/then.rb +1 -1
- data/lib/arel_extensions/nodes/trim.rb +2 -2
- data/lib/arel_extensions/nodes/union.rb +4 -4
- data/lib/arel_extensions/nodes/union_all.rb +3 -3
- data/lib/arel_extensions/nodes/wday.rb +0 -0
- data/lib/arel_extensions/nodes.rb +0 -0
- data/lib/arel_extensions/null_functions.rb +0 -0
- data/lib/arel_extensions/predications.rb +10 -10
- data/lib/arel_extensions/railtie.rb +1 -1
- data/lib/arel_extensions/set_functions.rb +3 -3
- data/lib/arel_extensions/string_functions.rb +8 -8
- data/lib/arel_extensions/tasks.rb +2 -2
- data/lib/arel_extensions/version.rb +1 -1
- data/lib/arel_extensions/visitors/convert_format.rb +0 -0
- data/lib/arel_extensions/visitors/ibm_db.rb +20 -20
- data/lib/arel_extensions/visitors/mssql.rb +150 -130
- data/lib/arel_extensions/visitors/mysql.rb +147 -149
- data/lib/arel_extensions/visitors/oracle.rb +141 -135
- data/lib/arel_extensions/visitors/oracle12.rb +16 -16
- data/lib/arel_extensions/visitors/postgresql.rb +147 -139
- data/lib/arel_extensions/visitors/sqlite.rb +85 -87
- data/lib/arel_extensions/visitors/to_sql.rb +146 -148
- data/lib/arel_extensions/visitors.rb +7 -7
- data/lib/arel_extensions.rb +56 -32
- data/test/arelx_test_helper.rb +14 -13
- data/test/database.yml +5 -5
- data/test/real_db_test.rb +81 -81
- data/test/support/fake_record.rb +2 -2
- data/test/test_comparators.rb +5 -5
- data/test/visitors/test_bulk_insert_oracle.rb +5 -5
- data/test/visitors/test_bulk_insert_sqlite.rb +5 -5
- data/test/visitors/test_bulk_insert_to_sql.rb +5 -5
- data/test/visitors/test_oracle.rb +14 -14
- data/test/visitors/test_to_sql.rb +87 -87
- data/test/with_ar/all_agnostic_test.rb +411 -306
- data/test/with_ar/insert_agnostic_test.rb +19 -16
- data/test/with_ar/test_bulk_sqlite.rb +5 -5
- data/test/with_ar/test_math_sqlite.rb +12 -12
- data/test/with_ar/test_string_mysql.rb +20 -20
- data/test/with_ar/test_string_sqlite.rb +20 -20
- data/version_v1.rb +1 -1
- data/version_v2.rb +1 -1
- metadata +3 -9
- data/.travis/oracle/download.js +0 -152
- data/.travis/oracle/download.sh +0 -30
- data/.travis/oracle/download_ojdbc.js +0 -116
- data/.travis/oracle/install.sh +0 -34
- data/.travis/setup_accounts.sh +0 -9
- data/.travis/sqlite3/extension-functions.sh +0 -6
- data/.travis.yml +0 -193
data/.travis/oracle/install.sh
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
#!/bin/sh -e
|
2
|
-
# vim: set et sw=2 ts=2:
|
3
|
-
|
4
|
-
[ -z "$ORACLE_DOWNLOAD_DIR" ] || ORACLE_DOWNLOAD_DIR="$(readlink -f "$ORACLE_DOWNLOAD_DIR")/"
|
5
|
-
[ -n "$ORACLE_FILE" ] || { echo "Missing ORACLE_FILE environment variable!"; exit 1; }
|
6
|
-
[ -n "$ORACLE_HOME" ] || { echo "Missing ORACLE_HOME environment variable!"; exit 1; }
|
7
|
-
|
8
|
-
ORACLE_RPM="$(basename "$ORACLE_FILE" .zip)"
|
9
|
-
|
10
|
-
cd "$(dirname "$(readlink -f "$0")")"
|
11
|
-
|
12
|
-
dpkg -s bc libaio1 rpm unzip > /dev/null 2>&1 ||
|
13
|
-
( sudo apt-get -qq update && sudo apt-get --no-install-recommends -qq install bc libaio1 rpm unzip )
|
14
|
-
|
15
|
-
df -B1 /dev/shm | awk 'END { if ($1 != "shmfs" && $1 != "tmpfs" || $2 < 2147483648) exit 1 }' ||
|
16
|
-
( sudo rm -r /dev/shm && sudo mkdir /dev/shm && sudo mount -t tmpfs shmfs -o size=2G /dev/shm )
|
17
|
-
|
18
|
-
test -f /sbin/chkconfig ||
|
19
|
-
( echo '#!/bin/sh' | sudo tee /sbin/chkconfig > /dev/null && sudo chmod u+x /sbin/chkconfig )
|
20
|
-
|
21
|
-
test -d /var/lock/subsys || sudo mkdir /var/lock/subsys
|
22
|
-
|
23
|
-
unzip -j "${ORACLE_DOWNLOAD_DIR}$(basename "$ORACLE_FILE")" "*/$ORACLE_RPM"
|
24
|
-
sudo rpm --install --nodeps --nopre "$ORACLE_RPM"
|
25
|
-
|
26
|
-
echo 'OS_AUTHENT_PREFIX=""' | sudo tee -a "$ORACLE_HOME/config/scripts/init.ora" > /dev/null
|
27
|
-
sudo usermod -aG dba $USER
|
28
|
-
|
29
|
-
( echo ; echo ; echo travis ; echo travis ; echo n ) | sudo AWK='/usr/bin/awk' /etc/init.d/oracle-xe configure
|
30
|
-
|
31
|
-
"$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA <<SQL
|
32
|
-
CREATE USER $USER IDENTIFIED EXTERNALLY;
|
33
|
-
GRANT CONNECT, RESOURCE TO $USER;
|
34
|
-
SQL
|
data/.travis/setup_accounts.sh
DELETED
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
|