sqb 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/sqb/index_hint.rb +16 -0
- data/lib/sqb/select.rb +6 -0
- data/lib/sqb/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 737a0396c7f6c7bd7eb582b08e786e89b9e2922e58215a8ea3504582d7ab30a2
|
4
|
+
data.tar.gz: 23b36444197b567e9dc07379be719e1b368aad5cece69fb03ae0d37b16910fcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d693e5a6eab235bfc13056d34fc7738a137e97732c6f4f14665f5fedafd3eeedda258eddfff3a6eecb9387c78397643aac54fd1c257f256fddef15b2ca52fa9f
|
7
|
+
data.tar.gz: 22ac438163afe97e76f0a1561bce6a15186dd0c99d405acdb2514484406549ae229a6e6fd41237ba34f5f9a340e43ab15a5dcf527a7080e897ed42348ba7cd37
|
data/lib/sqb/select.rb
CHANGED
@@ -7,6 +7,7 @@ require 'sqb/ordering'
|
|
7
7
|
require 'sqb/grouping'
|
8
8
|
require 'sqb/limiting'
|
9
9
|
require 'sqb/offsetting'
|
10
|
+
require 'sqb/index_hint'
|
10
11
|
|
11
12
|
module SQB
|
12
13
|
class Select < Base
|
@@ -19,6 +20,7 @@ module SQB
|
|
19
20
|
include SQB::Grouping
|
20
21
|
include SQB::Limiting
|
21
22
|
include SQB::Offsetting
|
23
|
+
include SQB::IndexHint
|
22
24
|
|
23
25
|
def to_sql
|
24
26
|
[].tap do |query|
|
@@ -33,6 +35,10 @@ module SQB
|
|
33
35
|
query << "FROM"
|
34
36
|
query << escape_and_join(@options[:database_name], @table_name)
|
35
37
|
|
38
|
+
if @index_hints && !@index_hints.empty?
|
39
|
+
query << 'USE INDEX (' + @index_hints.join(', ') + ')'
|
40
|
+
end
|
41
|
+
|
36
42
|
if @joins && !@joins.empty?
|
37
43
|
query << @joins.join(' ')
|
38
44
|
end
|
data/lib/sqb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A friendly SQL builder for MySQL.
|
14
14
|
email:
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- lib/sqb/escaping.rb
|
27
27
|
- lib/sqb/filtering.rb
|
28
28
|
- lib/sqb/grouping.rb
|
29
|
+
- lib/sqb/index_hint.rb
|
29
30
|
- lib/sqb/insert.rb
|
30
31
|
- lib/sqb/joins.rb
|
31
32
|
- lib/sqb/limiting.rb
|
@@ -58,8 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
59
|
- !ruby/object:Gem::Version
|
59
60
|
version: '0'
|
60
61
|
requirements: []
|
61
|
-
|
62
|
-
rubygems_version: 2.5.2.3
|
62
|
+
rubygems_version: 3.0.6
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: This gem provides a friendly DSL for constructing MySQL queries.
|