getto-repository-sequel 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.envrc +1 -0
- data/.gitlab-ci.yml +7 -0
- data/.release-version +1 -0
- data/CHANGELOG/1.1.0.md +8 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +34 -0
- data/bin/push_tags.sh +7 -0
- data/lib/getto/repository/sequel/search.rb +8 -0
- data/lib/getto/repository/sequel/version.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4f588c29dd705f9a1510b2a775765790658d92f0ff65a50b7464ba254e783cb
|
4
|
+
data.tar.gz: 10327bc279222b73ca930ef53f4a564b05f9bcb3092eb1d48ffc69c488cb6d0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17e094d23c936d6236cbcba16ef632176772f66c168c6f5e5fc87fda342f0a85cfa172d347c2c4f7106a2add96d453609ef23f0454ed79f7b1faa365b50b2033
|
7
|
+
data.tar.gz: b48e998e3f075cacb71902f9461759a0abb8c76a9395386fc37bbf72c98832bf755f5ea776d193f40796480acbdd4fed337b18089d29b3aa7998b5b4390e97eb
|
data/.envrc
CHANGED
data/.gitlab-ci.yml
CHANGED
data/.release-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.1.0
|
data/CHANGELOG/1.1.0.md
ADDED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
getto-repository-sequel (1.0
|
4
|
+
getto-repository-sequel (1.1.0)
|
5
5
|
getto-initialize_with (~> 1.0)
|
6
6
|
getto-repository (~> 1.0)
|
7
7
|
sequel (~> 5.13.0)
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
specs:
|
12
12
|
docile (1.3.1)
|
13
13
|
getto-initialize_with (1.0.4)
|
14
|
-
getto-repository (1.0.
|
14
|
+
getto-repository (1.0.2)
|
15
15
|
json (2.1.0)
|
16
16
|
minitest (5.11.3)
|
17
17
|
rake (10.5.0)
|
data/README.md
CHANGED
@@ -47,6 +47,9 @@ search = Getto::Repository::Search::Sequel.new(
|
|
47
47
|
"name.cont_any": "カナ",
|
48
48
|
|
49
49
|
"active.in": ["True"],
|
50
|
+
|
51
|
+
"date.gteq": "2018-10-01",
|
52
|
+
"date.lteq": "2018-10-31",
|
50
53
|
},
|
51
54
|
)
|
52
55
|
|
@@ -70,6 +73,9 @@ where = search.where do |w|
|
|
70
73
|
"False" => false,
|
71
74
|
)
|
72
75
|
)
|
76
|
+
|
77
|
+
w.search "date.gteq", &w.gteq(::Sequel[:accounts][:created_at])
|
78
|
+
w.search "date.lteq", &w.lteq(::Sequel[:accounts][:created_at])
|
73
79
|
end
|
74
80
|
|
75
81
|
order = search.order do |o|
|
@@ -168,6 +174,34 @@ WHERE
|
|
168
174
|
(`accounts`.`id` = 1)
|
169
175
|
```
|
170
176
|
|
177
|
+
- less than or equals to
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
where = search.where do |w|
|
181
|
+
w.search "date.lteq", &w.lteq(::Sequel[:accounts][:created_at])
|
182
|
+
end
|
183
|
+
```
|
184
|
+
|
185
|
+
```sql
|
186
|
+
-- { "date.lteq": "2018-10-01" }
|
187
|
+
WHERE
|
188
|
+
(`accounts`.`created_at` <= "2018-10-01")
|
189
|
+
```
|
190
|
+
|
191
|
+
- greater than or equals to
|
192
|
+
|
193
|
+
```ruby
|
194
|
+
where = search.where do |w|
|
195
|
+
w.search "date.gteq", &w.gteq(::Sequel[:accounts][:created_at])
|
196
|
+
end
|
197
|
+
```
|
198
|
+
|
199
|
+
```sql
|
200
|
+
-- { "date.gteq": "2018-10-01" }
|
201
|
+
WHERE
|
202
|
+
(`accounts`.`created_at` >= "2018-10-01")
|
203
|
+
```
|
204
|
+
|
171
205
|
- contains
|
172
206
|
|
173
207
|
```ruby
|
data/bin/push_tags.sh
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
git remote add super https://gett-systems:$GITLAB_ACCESS_TOKEN@gitlab.com/getto-systems-labo/rubygems-repository-sequel.git
|
4
|
+
git remote add github https://getto-systems:$GITHUB_ACCESS_TOKEN@github.com/getto-systems/rubygems-getto-repository-sequel.git
|
5
|
+
git tag $(cat .release-version)
|
6
|
+
git push super HEAD:master --tags
|
7
|
+
git push github HEAD:master --tags
|
@@ -64,6 +64,14 @@ module Getto
|
|
64
64
|
->(value){ { column => value } }
|
65
65
|
end
|
66
66
|
|
67
|
+
def gteq(column)
|
68
|
+
->(value){ ::Sequel.lit("? >= ?", column, value) }
|
69
|
+
end
|
70
|
+
|
71
|
+
def lteq(column)
|
72
|
+
->(value){ ::Sequel.lit("? <= ?", column, value) }
|
73
|
+
end
|
74
|
+
|
67
75
|
def is_not_null(column,map)
|
68
76
|
->(value){
|
69
77
|
if map.has_key?(value)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getto-repository-sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shun@getto.systems
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: getto-initialize_with
|
@@ -121,16 +121,19 @@ files:
|
|
121
121
|
- ".git_release_request.rc.sh"
|
122
122
|
- ".gitignore"
|
123
123
|
- ".gitlab-ci.yml"
|
124
|
+
- ".release-version"
|
124
125
|
- ".travis.yml"
|
125
126
|
- CHANGELOG.md
|
126
127
|
- CHANGELOG/1.0.0.md
|
127
128
|
- CHANGELOG/1.0.1.md
|
128
129
|
- CHANGELOG/1.0.2.md
|
130
|
+
- CHANGELOG/1.1.0.md
|
129
131
|
- Gemfile
|
130
132
|
- Gemfile.lock
|
131
133
|
- LICENSE
|
132
134
|
- README.md
|
133
135
|
- Rakefile
|
136
|
+
- bin/push_tags.sh
|
134
137
|
- getto-repository-sequel.gemspec
|
135
138
|
- lib/getto/repository/sequel.rb
|
136
139
|
- lib/getto/repository/sequel/search.rb
|
@@ -159,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
162
|
version: '0'
|
160
163
|
requirements: []
|
161
164
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.7.
|
165
|
+
rubygems_version: 2.7.8
|
163
166
|
signing_key:
|
164
167
|
specification_version: 4
|
165
168
|
summary: Repository helper for Sequel
|