diff --git a/Gemfile b/Gemfile index 8867700..0890e19 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -gem "pg_query", ">= 1.0", "< 2" +gem "pg_query", ">= 1.0", "< 3" group :development do gem "rspec" diff --git a/Gemfile.lock b/Gemfile.lock index 7ba840b..d98a4b6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,27 +1,29 @@ GEM remote: https://rubygems.org/ specs: - diff-lcs (1.3) - pg_query (1.2.0) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.1) - rspec-support (~> 3.9.1) - rspec-expectations (3.9.0) + diff-lcs (1.4.4) + google-protobuf (3.15.6) + pg_query (2.0.1) + google-protobuf (~> 3.15.5) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.2) + rspec-support (~> 3.10.0) + rspec-support (3.10.2) PLATFORMS ruby DEPENDENCIES - pg_query (>= 1.0, < 2) + pg_query (>= 1.0, < 3) rspec BUNDLED WITH diff --git a/lib/sqlint/version.rb b/lib/sqlint/version.rb index dab26e1..38e9eef 100644 --- a/lib/sqlint/version.rb +++ b/lib/sqlint/version.rb @@ -1,3 +1,3 @@ module SQLint - VERSION = "0.1.10" + VERSION = "0.2.0" end diff --git a/spec/linter_spec.rb b/spec/linter_spec.rb index dc05c97..f41a35a 100644 --- a/spec/linter_spec.rb +++ b/spec/linter_spec.rb @@ -25,6 +25,20 @@ def warning(line, col, msg) end end + context "with valid PG 12 syntax" do + let(:input) do <<-EOF + CREATE TABLE things ( + x_in numeric, + x_cm numeric GENERATED ALWAYS AS (x / 2.54) STORED + ); + EOF + end + + it "reports no errors" do + expect(results).to be_empty + end + end + describe "single errors" do context "with a single valid statement" do it "reports no errors" do diff --git a/sqlint.gemspec b/sqlint.gemspec index fe64d08..d4d5b4f 100644 --- a/sqlint.gemspec +++ b/sqlint.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |s| s.rubygems_version = '1.8.23' s.summary = 'Simple SQL linter.' - s.add_runtime_dependency('pg_query', '~> 1') + s.add_runtime_dependency('pg_query', '~> 2') s.add_development_dependency('rake', '~> 10.1') s.add_development_dependency('rspec', '~> 3.2') s.add_development_dependency('bundler', '~> 1.3')