sql_csv 0.1.0 → 0.2.1

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: 0e8f0d24b875a194bca3fe3ea55f7741e461b8fbc909b12fb76637e38695de00
4
- data.tar.gz: 65613b618400bf35f9e2213ae7f224865a6d39b9260dae68ee8b7fdf01fc12e3
3
+ metadata.gz: 1bd2654196dbfc8626ab6d0568a32db5880243b82b3628e30313236f92c0128a
4
+ data.tar.gz: cfad58ce7083277a5b48ce6105065901e9a150c89a89739e07beadebfc472b78
5
5
  SHA512:
6
- metadata.gz: c732347d59799308e3453db21951e7e5696ca0807ffedbfcca1509a6581db21c32d5939020079efd6e49a64c066af85be7c85d69e0d5a85c8cbfe25d0149f8a0
7
- data.tar.gz: 8507cbed40c4f90b5608765fb1767a8af1ffbd2e523c5cecea571f4447f3fee5feb723fbad5acc8367f5eec8f9a9bbcbf8fa0cd35a6ed52264c804709713e997
6
+ metadata.gz: 73a3c755832a78a6f3851c15f094c9aa02ac069172af9d9bfe6fcc1c23747c28396c21e34c017e7181230b63d2fa1b4e3af740a75922dd7815da06f80eca3106
7
+ data.tar.gz: bea69e70f051cad2bb27404ac8f54b1015796e48db92e439246ec691088ae90a09dd667d65a499e9c9ae34f9fab35088bd60da45e47db33481fc9716f551d69f
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  .byebug_history
13
+ *.gem
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.4
1
+ 2.7.6
data/Gemfile CHANGED
@@ -5,9 +5,9 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in sql_csv.gemspec
6
6
  gemspec
7
7
 
8
- gem 'rake', '~> 12.0'
9
- gem 'rspec', '~> 3.0'
10
- gem 'rubocop', '~> 1.21'
8
+ gem 'rake', '~> 13.0'
9
+ gem 'rspec', '~> 3.11'
10
+ gem 'rubocop', '~> 1.29'
11
11
  gem 'rubocop-rake', '~> 0.6.0'
12
- gem 'rubocop-rspec', '~> 2.5'
12
+ gem 'rubocop-rspec', '~> 2.10'
13
13
  gem 'strong_versions', '~> 0.4.5'
data/Gemfile.lock CHANGED
@@ -1,67 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sql_csv (0.1.0)
4
+ sql_csv (0.2.0)
5
5
  activerecord (~> 6.1)
6
6
  mysql2 (~> 0.5.3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.1.4.1)
12
- activesupport (= 6.1.4.1)
13
- activerecord (6.1.4.1)
14
- activemodel (= 6.1.4.1)
15
- activesupport (= 6.1.4.1)
16
- activesupport (6.1.4.1)
11
+ activemodel (6.1.5)
12
+ activesupport (= 6.1.5)
13
+ activerecord (6.1.5)
14
+ activemodel (= 6.1.5)
15
+ activesupport (= 6.1.5)
16
+ activesupport (6.1.5)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
21
  zeitwerk (~> 2.3)
22
22
  ast (2.4.2)
23
- concurrent-ruby (1.1.9)
23
+ concurrent-ruby (1.1.10)
24
24
  devpack (0.3.2)
25
- diff-lcs (1.4.4)
26
- i18n (1.8.10)
25
+ diff-lcs (1.5.0)
26
+ i18n (1.10.0)
27
27
  concurrent-ruby (~> 1.0)
28
- minitest (5.14.4)
28
+ minitest (5.15.0)
29
29
  mysql2 (0.5.3)
30
30
  paint (2.2.1)
31
- parallel (1.21.0)
32
- parser (3.0.2.0)
31
+ parallel (1.22.1)
32
+ parser (3.1.2.0)
33
33
  ast (~> 2.4.1)
34
- rainbow (3.0.0)
35
- rake (12.3.3)
36
- regexp_parser (2.1.1)
34
+ rainbow (3.1.1)
35
+ rake (13.0.6)
36
+ regexp_parser (2.3.1)
37
37
  rexml (3.2.5)
38
- rspec (3.10.0)
39
- rspec-core (~> 3.10.0)
40
- rspec-expectations (~> 3.10.0)
41
- rspec-mocks (~> 3.10.0)
42
- rspec-core (3.10.1)
43
- rspec-support (~> 3.10.0)
44
- rspec-expectations (3.10.1)
38
+ rspec (3.11.0)
39
+ rspec-core (~> 3.11.0)
40
+ rspec-expectations (~> 3.11.0)
41
+ rspec-mocks (~> 3.11.0)
42
+ rspec-core (3.11.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-expectations (3.11.0)
45
45
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.10.0)
47
- rspec-mocks (3.10.2)
46
+ rspec-support (~> 3.11.0)
47
+ rspec-mocks (3.11.1)
48
48
  diff-lcs (>= 1.2.0, < 2.0)
49
- rspec-support (~> 3.10.0)
50
- rspec-support (3.10.2)
51
- rubocop (1.21.0)
49
+ rspec-support (~> 3.11.0)
50
+ rspec-support (3.11.0)
51
+ rubocop (1.29.0)
52
52
  parallel (~> 1.10)
53
- parser (>= 3.0.0.0)
53
+ parser (>= 3.1.0.0)
54
54
  rainbow (>= 2.2.2, < 4.0)
55
55
  regexp_parser (>= 1.8, < 3.0)
56
- rexml
57
- rubocop-ast (>= 1.9.1, < 2.0)
56
+ rexml (>= 3.2.5, < 4.0)
57
+ rubocop-ast (>= 1.17.0, < 2.0)
58
58
  ruby-progressbar (~> 1.7)
59
59
  unicode-display_width (>= 1.4.0, < 3.0)
60
- rubocop-ast (1.11.0)
61
- parser (>= 3.0.1.1)
60
+ rubocop-ast (1.17.0)
61
+ parser (>= 3.1.1.0)
62
62
  rubocop-rake (0.6.0)
63
63
  rubocop (~> 1.0)
64
- rubocop-rspec (2.5.0)
64
+ rubocop-rspec (2.10.0)
65
65
  rubocop (~> 1.19)
66
66
  ruby-progressbar (1.11.0)
67
67
  strong_versions (0.4.5)
@@ -70,18 +70,18 @@ GEM
70
70
  tzinfo (2.0.4)
71
71
  concurrent-ruby (~> 1.0)
72
72
  unicode-display_width (2.1.0)
73
- zeitwerk (2.4.2)
73
+ zeitwerk (2.5.4)
74
74
 
75
75
  PLATFORMS
76
76
  ruby
77
77
 
78
78
  DEPENDENCIES
79
79
  devpack (~> 0.3.2)
80
- rake (~> 12.0)
81
- rspec (~> 3.0)
82
- rubocop (~> 1.21)
80
+ rake (~> 13.0)
81
+ rspec (~> 3.11)
82
+ rubocop (~> 1.29)
83
83
  rubocop-rake (~> 0.6.0)
84
- rubocop-rspec (~> 2.5)
84
+ rubocop-rspec (~> 2.10)
85
85
  sql_csv!
86
86
  strong_versions (~> 0.4.5)
87
87
 
data/README.md CHANGED
@@ -18,6 +18,16 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install sql_csv
20
20
 
21
+ ## Usage
22
+
23
+ An executable `sql2csv` is installed with the gem.
24
+
25
+ Write an SQL command to `stdin` and set `DATABASE_URL` to configure connection. CSV output will be written to `stdout`.
26
+
27
+ ```bash
28
+ echo "select * from users" | DATABASE_URL='postgresql://user:password@host:1234/database' sql2csv > users.csv
29
+ ```
30
+
21
31
  ## License
22
32
 
23
33
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
4
  require 'sql_csv'
6
5
 
7
6
  query = ARGV.size.positive? ? ARGV[0] : $stdin.read
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SqlCsv
4
- VERSION = '0.1.0'
4
+ VERSION = '0.2.1'
5
5
  end
data/sql_csv.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  end
23
23
 
24
24
  spec.bindir = 'bin'
25
- spec.executables = []
25
+ spec.executables = ['sql2csv']
26
26
  spec.require_paths = ['lib']
27
27
  spec.add_runtime_dependency 'activerecord', '~> 6.1'
28
28
  spec.add_runtime_dependency 'mysql2', '~> 0.5.3'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sql_csv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-21 00:00:00.000000000 Z
11
+ date: 2022-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -55,7 +55,8 @@ dependencies:
55
55
  description: Use ActiveRecord to execute SQL against any DB to export CSV
56
56
  email:
57
57
  - git@bob.frl
58
- executables: []
58
+ executables:
59
+ - sql2csv
59
60
  extensions: []
60
61
  extra_rdoc_files: []
61
62
  files:
@@ -71,7 +72,7 @@ files:
71
72
  - Rakefile
72
73
  - bin/console
73
74
  - bin/setup
74
- - bin/sql_csv
75
+ - bin/sql2csv
75
76
  - lib/sql_csv.rb
76
77
  - lib/sql_csv/version.rb
77
78
  - sql_csv.gemspec