stairwell 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c4e331d0e1037b7e3a1e52cc0390bf84797e4898fa4d978e73a99454b81f37f
4
- data.tar.gz: b58a61a030aa209e8b04511011a6dc1319d984d7347c5fdd23b581669a6220f2
3
+ metadata.gz: e963ad4c2388946d0baae50090e6f3e9913e49dcdd896cdd18403861d72b9a40
4
+ data.tar.gz: 29cb2a589732e6e4b0b43115da878d8b4463eb59a1ad46726d01595bc0f56f19
5
5
  SHA512:
6
- metadata.gz: cc90cda2b768f201a94b04241b3f09bb555433e18ddfc8781ceb33f5a88ec641a1ad602f69f17c4da55b425757bfcb12115f95ec09c512ec999691f80ca688a0
7
- data.tar.gz: 80c07a75ad1970ca578374a48757990edd1e1d19f37b97fb1bae8ceba3c236e629a7c4ba8ae5b03d44d4837835a49c2ce875851576d09d22f005c07f5a329e97
6
+ metadata.gz: 0d21bd2ad1fc8a8b04de7da744dae787a474a33fbb42146a4b77d218d5ee493c25ed930da39b23a4ce45a67448920924e5d2a4006ba62978422caf3c43156395
7
+ data.tar.gz: 229bc47578fea9e530d10291d79d94bcd042222e767f5627b45e4b7867af09e76958a34b9d4208b6763c1d89fcea5399317ad6c4047c547e2bae11e62361f61c
data/Gemfile.lock CHANGED
@@ -1,39 +1,52 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stairwell (0.1.2)
4
+ stairwell (0.3.0)
5
5
  activerecord (>= 4.2.11)
6
6
  sqlite3
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.0.3.4)
12
- activesupport (= 6.0.3.4)
13
- activerecord (6.0.3.4)
14
- activemodel (= 6.0.3.4)
15
- activesupport (= 6.0.3.4)
16
- activesupport (6.0.3.4)
11
+ activemodel (7.1.1)
12
+ activesupport (= 7.1.1)
13
+ activerecord (7.1.1)
14
+ activemodel (= 7.1.1)
15
+ activesupport (= 7.1.1)
16
+ timeout (>= 0.4.0)
17
+ activesupport (7.1.1)
18
+ base64
19
+ bigdecimal
17
20
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- zeitwerk (~> 2.2, >= 2.2.2)
21
+ connection_pool (>= 2.2.5)
22
+ drb
23
+ i18n (>= 1.6, < 2)
24
+ minitest (>= 5.1)
25
+ mutex_m
26
+ tzinfo (~> 2.0)
27
+ base64 (0.1.1)
28
+ bigdecimal (3.1.4)
22
29
  coderay (1.1.3)
23
- concurrent-ruby (1.1.7)
24
- i18n (1.8.5)
30
+ concurrent-ruby (1.2.2)
31
+ connection_pool (2.4.1)
32
+ drb (2.1.1)
33
+ ruby2_keywords
34
+ i18n (1.14.1)
25
35
  concurrent-ruby (~> 1.0)
26
36
  method_source (1.0.0)
27
- minitest (5.14.2)
37
+ mini_portile2 (2.8.5)
38
+ minitest (5.20.0)
39
+ mutex_m (0.1.2)
28
40
  pry (0.13.1)
29
41
  coderay (~> 1.1)
30
42
  method_source (~> 1.0)
31
43
  rake (12.3.3)
32
- sqlite3 (1.4.2)
33
- thread_safe (0.3.6)
34
- tzinfo (1.2.7)
35
- thread_safe (~> 0.1)
36
- zeitwerk (2.4.0)
44
+ ruby2_keywords (0.0.5)
45
+ sqlite3 (1.6.7)
46
+ mini_portile2 (~> 2.8.0)
47
+ timeout (0.4.0)
48
+ tzinfo (2.0.6)
49
+ concurrent-ruby (~> 1.0)
37
50
 
38
51
  PLATFORMS
39
52
  ruby
data/README.md CHANGED
@@ -18,6 +18,12 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install stairwell
20
20
 
21
+ ## Why?
22
+ Although ActiveRecord serves as an excellent tool for the majority of database queries, certain scenarios call for more customized queries.
23
+ This project was initially conceived to help transition a development team and their project from PHP to Ruby. This PHP project had thousands of complex SQL queries, thus the necessity of making SQL a first-class citizen in the ruby project enabled a smoother transition.
24
+ So, why not Arel? Arel is a powerful tool, but it's worth noting that it is considered a private API and is likely to remain so for the forseeable future.
25
+ Does this approach make queries less composable? Yes, if you are used to chaining your arel queries and AR scopes then you're probably not going to use this. However, it provides an interface that enables you to leverage SQL securely in your Ruby projects without the need to reinvent the wheel.
26
+
21
27
  ## Usage
22
28
 
23
29
  Define a class in your app that inherits from `Stairwell::Query`. We're going to assume you are in a rails app, but this will work in any ruby app, although ActiveRecord is a dependency of this gem.
@@ -57,7 +63,7 @@ binds = {
57
63
  name: "First",
58
64
  age: 99,
59
65
  active: true,
60
- gpa: 4.2
66
+ gpa: 4.2,
61
67
  date_joined: "2008-08-28",
62
68
  created_at: "2008-08-28 23:41:18",
63
69
  favorite_numbers: [4, 7, 100]
@@ -1,3 +1,3 @@
1
1
  module Stairwell
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stairwell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tobyond
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-08 00:00:00.000000000 Z
11
+ date: 2023-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.1.2
94
+ rubygems_version: 3.4.10
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: stairwell for sql