sqb 1.0.3 → 1.0.4

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: b3c57f511a3e18b3718cbbcd5e6703b52bd0b3d6e92ead8aca02a04ef46b087a
4
- data.tar.gz: 2fd0e2d396c722bf2d0fcac632a8322be95ab3aa65b64ba70d86b62ca5859d98
3
+ metadata.gz: 86bb79014e513987ddd1093cb0fa906e911048624dfbd13a590dc02e287957e7
4
+ data.tar.gz: f07f4b6efa8d19f792e00ccd5194304fc70f0434fb93c8609940757c8fec42d5
5
5
  SHA512:
6
- metadata.gz: ba298f55cf459a29818711e146c78b58911a1673c277879d013f2333e31729b733fa686af429931797aad1b1d5dfb0ea43c0b31364d4ac3c1f68f99ded75d4d9
7
- data.tar.gz: 8e4c5e633e78f78689a2d60e8574bb5e86de9d0c0305ace9e4c46e64daadc9c971a3615da18fa5825e295081e2b3eabd6c61b43d9f185b18de10f98ebdfa83e0
6
+ metadata.gz: 6e9ac660c7c36c57fe536b63560d63a0da407cead1164e367dfadf363db7e39b27820186701a1cbd3cd11a6f978d920d57b952fe3f970ce99a45060d83d9ffd9
7
+ data.tar.gz: d606e7bce05701fb3b1e14f6e8ef591546403a4697579228d4505afec554cf9ab7c114ecd706d71fd31ccdf6d2a8ab3422d193ec8a118ce45622eee66140fdd3
data/lib/sqb.rb CHANGED
@@ -8,7 +8,11 @@ require 'sqb/delete'
8
8
  require 'sqb/insert'
9
9
 
10
10
  module SQB
11
+
12
+ STAR = Object.new
13
+
11
14
  def self.safe(string)
12
15
  SafeString.new(string)
13
16
  end
17
+
14
18
  end
data/lib/sqb/escaping.rb CHANGED
@@ -6,6 +6,8 @@ module SQB
6
6
  def escape(name)
7
7
  if name.is_a?(SafeString)
8
8
  name
9
+ elsif name == SQB::STAR
10
+ "*"
9
11
  else
10
12
  "`#{name.to_s.gsub('`', '``')}`"
11
13
  end
data/lib/sqb/select.rb CHANGED
@@ -25,7 +25,7 @@ module SQB
25
25
  query << "SELECT"
26
26
  query << "DISTINCT" if @distinct
27
27
  if @columns.nil? || @columns.empty?
28
- query << escape_and_join(@table_name, '*')
28
+ query << escape_and_join(@table_name, SQB::STAR)
29
29
  else
30
30
  query << @columns.join(', ')
31
31
  end
data/lib/sqb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module SQB
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Cooke