db 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/db/context/session.rb +2 -2
- data/lib/db/query.rb +5 -11
- data/lib/db/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cde27a0a6510347217c2823470f138bd5d35bac35292f0ff7a085ec5c37c26c
|
4
|
+
data.tar.gz: 4e597ecdbfb05092a2a5c7f3f57ea2816ac16e7cfd05f5b1ca92ffeabe298fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 829dd25eeaf87078bfaee1f719040abae45fcd531cd00e68dc57e6abc6cad637fbd95e60bcd0305945f580eba893ea52c5a9f341dcca9e01b5f963b64256209c
|
7
|
+
data.tar.gz: 2a6726e95b389ad06810f0c14cd4abdb90997aa3bfe419aff8a284feff613c879b36d170f7392078e078719e831070419535258fd65a1b4e42c593a0015435a1
|
data/lib/db/context/session.rb
CHANGED
data/lib/db/query.rb
CHANGED
@@ -23,22 +23,16 @@
|
|
23
23
|
module DB
|
24
24
|
# Represents one or more identifiers for databases, tables or columns.
|
25
25
|
class Identifier < Array
|
26
|
-
# Construct an identifier from an array of names.
|
27
|
-
# e.g. `DB::Identifier[:mytable, :mycolumn]`
|
28
|
-
#
|
29
|
-
# @parameter names [Array] The array of names.
|
30
|
-
def self.[](*names)
|
31
|
-
self.new(names)
|
32
|
-
end
|
33
|
-
|
34
26
|
def self.coerce(name_or_identifier)
|
35
27
|
case name_or_identifier
|
36
28
|
when Identifier
|
37
29
|
name_or_identifier
|
38
|
-
when
|
30
|
+
when Array
|
39
31
|
self.new(name_or_identifier)
|
32
|
+
when Symbol
|
33
|
+
self[name_or_identifier]
|
40
34
|
else
|
41
|
-
self
|
35
|
+
self[name_or_identifier.to_sym]
|
42
36
|
end
|
43
37
|
end
|
44
38
|
|
@@ -61,7 +55,7 @@ module DB
|
|
61
55
|
# @parameter value [String] A raw SQL string, e.g. `WHERE x > 10`.
|
62
56
|
# @returns [Query] The mutable query itself.
|
63
57
|
def clause(value)
|
64
|
-
@buffer << ' ' unless @buffer.end_with?(' ')
|
58
|
+
@buffer << ' ' unless @buffer.end_with?(' ') || @buffer.empty?
|
65
59
|
|
66
60
|
@buffer << value
|
67
61
|
|
data/lib/db/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-io
|