tsql_parser 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddacc151a5ff2930d1bf0e7501a53711503811c123fdcc1fa74a5e3926435c94
4
- data.tar.gz: 3ac0fa643de5be751c55544bb2b226c8e8e5b062f56d8910db01f853c5400597
3
+ metadata.gz: b757cb7f1ee4f8b904d58f92dfe0c031a42e1c029c3fca2e9b9c276bc2c3954a
4
+ data.tar.gz: c0eb3a98483345e7a365800e400756c6bbdc7898d706f09f8759f17f044e0c06
5
5
  SHA512:
6
- metadata.gz: eb1cd578f4346f3ed104d5a177ee1f7a3d67f5030fa748df64a85156a364ad38e0efe0e9fc48770d5f216d5a0857c2d65250caee3e28974392fd864a47873227
7
- data.tar.gz: ace5d1a98579b17d3b48447691c61c3a0d346a090ba5462b54c6fa44c5ea7da1093825b71a6fb9b28e51f5e93785915f8e358e895011c236bf7ca3121865a84e
6
+ metadata.gz: ca7f2b2f2c15d508bfddfa725ca8d979132c018e4b44fef321249329f55cc220cc8ca50b2dc2f414d17daf336ad97b6617ee6e28b5afde3a07f900f710e057cd
7
+ data.tar.gz: 46171055a31591de3ff362ebf14dc45bd819399ab3e5acffad9810499f9440f4da99eace839b1b775a966b8ea31982691fdad746597c345e2c6aca14a0229c85
@@ -157,6 +157,7 @@ module TSqlParser::Parsing
157
157
  private
158
158
 
159
159
  def self.format_set(s, tab_count = 0, tab = " ")
160
+ return s if s.nil?
160
161
  parts = []
161
162
  builder = ''
162
163
  parenthesis = 0
@@ -179,6 +180,7 @@ module TSqlParser::Parsing
179
180
  end
180
181
 
181
182
  def self.format_update(s, tab_count = 0, tab = " ")
183
+ return s if s.nil?
182
184
  formatted = []
183
185
  parts = s.split(" SET ")
184
186
  table = parts[0]
@@ -190,6 +192,7 @@ module TSqlParser::Parsing
190
192
  end
191
193
 
192
194
  def self.format_insert(s, tab_count = 0, tab = " ")
195
+ return s if s.nil?
193
196
  formatted = []
194
197
  if s.include? ") VALUES ("
195
198
  tokens = s.split(") VALUES (")
@@ -205,11 +208,14 @@ module TSqlParser::Parsing
205
208
  end
206
209
 
207
210
  def self.format_select(s, tab_count = 0, tab = " ")
211
+ return s if s.nil?
212
+
208
213
  tokens = s.split(", ")
209
214
  "\n#{tokens.map { |t| "#{tab * (tab_count + 1)}#{t}" }.join(",\n")}"
210
215
  end
211
216
 
212
217
  def self.format_predicate(s, tab_count = 0, tab = " ")
218
+ return s if s.nil?
213
219
  indented = []
214
220
  formatted = []
215
221
  builder = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tsql_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Stauffer