soql_builder 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -0
- data/lib/soql/query.rb +8 -0
- data/lib/soql/version.rb +1 -1
- data/lib/soql_builder.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e01133aafa8d9360cb78ada93dd1a4d3fcaa9fa671831343202ac0414634f4b6
|
4
|
+
data.tar.gz: ead65eddcefbb4853110254ce559f78c6c620e31c5c7b7c8002166a6b441427d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97f41e9547619b75cb7534dd0ce4e4486c5bd36e5034e7f689948b295553a0022ba7a00dd47d533a5ee2b60979438d35e31c79242fd9593981de6db9e46b18e1
|
7
|
+
data.tar.gz: 4085a471ed4ed7eddce845f4a34f47174ed934d08800306cac99f0ee71ba5a86abdeb2f07c5f72d369ff1ac1c3aeee3cf86a98cd2451ad4a1d3ce94c7fa26c27
|
data/README.md
CHANGED
@@ -77,4 +77,30 @@ builder.query
|
|
77
77
|
=> "select Name, Contract__r.Name, (select Quotes.Name, Quotes.id from Account.Quotes) from Account where id = 1"
|
78
78
|
```
|
79
79
|
|
80
|
+
**Reset the query and create another one with the same object**
|
81
|
+
|
82
|
+
```ruby
|
83
|
+
builder.fields(['Name', 'Contract__r.Name'])
|
84
|
+
|
85
|
+
builder.add_subquery(
|
86
|
+
table: 'Account.Quotes',
|
87
|
+
fields: ['Quotes.Name', 'Quotes.id']
|
88
|
+
)
|
89
|
+
|
90
|
+
builder.from('Account')
|
91
|
+
|
92
|
+
builder.where('id = 1')
|
93
|
+
|
94
|
+
builder.query
|
95
|
+
=> "select Name, Contract__r.Name, (select Quotes.Name, Quotes.id from Account.Quotes) from Account where id = 1"
|
96
|
+
|
97
|
+
builder.clean
|
98
|
+
|
99
|
+
builder.fields(['Name', 'Contract__r.Name'])
|
100
|
+
.from('Account')
|
101
|
+
.where('id = 1')
|
102
|
+
|
103
|
+
builder.query
|
104
|
+
=> "select Name, Contract__r.Name from Account where id = 1"
|
105
|
+
```
|
80
106
|
|
data/lib/soql/query.rb
CHANGED
data/lib/soql/version.rb
CHANGED
data/lib/soql_builder.rb
CHANGED