slyce 1.2.1 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -2
  3. data/bin/slyce +4 -4
  4. data/bin/slyced +4 -4
  5. data/slyce.gemspec +2 -1
  6. metadata +19 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f40b8dfb3127b82f3c9ea3877afb4be3e2c1e93a70fc6308bd4710978eb8299a
4
- data.tar.gz: d328c938fcb4b833aed2a8c2772ce2eebc340aa6c620211150abaf29e6fae7a1
3
+ metadata.gz: 7e976689780c3b732b1254c1291868415a7d7e31c1c5144c93d9786df80697b8
4
+ data.tar.gz: 39f1fba4a6a32436bf407af6d4b52e71f7447390ed2eb8532338399b34175268
5
5
  SHA512:
6
- metadata.gz: 8bb4e9abe474a99ff73833a079faa0b1d485274ef5b6ff146b48114b207d997cbe4b9590e0bad87da628f263ec8c01c73e0138be760708fb4a5023d63a16a1af
7
- data.tar.gz: a920d2313061b4a6275ac6a0392ba6197f003482f011a1de80040f35f9db72fd240d612b2c94bd30f918f96c5736d02dab9691a7955c580a05c72f3e4fec4708
6
+ metadata.gz: 55cbbb017e93530759ea9d9239a8c18df4426c185e8c8d8f080816355124307189f7c2fe4c26bfbf86fac252679584ad078708186eaf023e664a57c6e52521a6
7
+ data.tar.gz: 52a9fafe8e978bc3614548e29ecdfd9afb48c121526e5f928a5463cca66128f17564706bb9645fe51e8ad5a03b18d562f5d35eec34edd31d8e4832bfd3086b5f
data/README.md CHANGED
@@ -2,17 +2,48 @@
2
2
 
3
3
  Ruby utility to show summary statistics or export data from MySQL, SQLite, or DuckDB.
4
4
 
5
+ ## Usage
6
+
7
+ ```
8
+ usage: slyce [options] <database> <table>
9
+ --csv Output comma separated values
10
+ --psv Output pipe separated values
11
+ --tsv Output tab separated values
12
+ -a, --ascii Convert data to ASCII using AnyAscii
13
+ -c, --columns Display column names and quit
14
+ -h, --help Show help and command usage
15
+ -n, --natural Sort naturally, not numerically
16
+ -r, --rows <count> Rows of data to select
17
+ -s, --suppress Suppress header when exporting delimited files
18
+ -v, --version Show version number
19
+ -w, --where <cond> Where clause (eg - 'age>50 and state='AZ')
20
+ -x, --extract <col1,col2,...> Comma separated list of columns to extract
21
+ ```
22
+
5
23
  ## Supported platforms
6
24
 
7
25
  ### MySQL
8
26
 
27
+ The executable is called `slyce`.
28
+
9
29
  ### SQLite
10
30
 
31
+ The executable is called `slyce3` and requires the `regexp` sqlite3 extension from https://github.com/nalgeon/sqlean
32
+
33
+ You can download the latest version at: https://github.com/nalgeon/sqlean/releases/latest
34
+
35
+ For example, on Apple Silicon with macOS with an M1 you can use:
36
+
37
+ ```
38
+ wget https://github.com/nalgeon/sqlean/releases/download/0.19.3/sqlean-macos-arm64.zip
39
+ unzip sqlean-macos-arm64.zip regexp.dylib
40
+ ```
41
+
11
42
  ### DuckDB
12
43
 
13
- Ensure the `duckdb` gem is installed via:
44
+ The executable is called `slyced`. It requires the `duckdb` gem, which can be installed with:
14
45
 
15
- `gem install duckdb`
46
+ ```gem install duckdb```
16
47
 
17
48
  ## Example
18
49
 
data/bin/slyce CHANGED
@@ -11,7 +11,7 @@ dbas = nil
11
11
  tabl = nil
12
12
 
13
13
  OptionParser.new.instance_eval do
14
- @version = "1.2.1"
14
+ @version = "1.2.4"
15
15
  @banner = "usage: #{program_name} [options] <database> <table>"
16
16
 
17
17
  on "--csv" , "Output comma separated values"
@@ -21,7 +21,7 @@ OptionParser.new.instance_eval do
21
21
  on "-c", "--columns" , "Display column names and quit"
22
22
  on "-h", "--help" , "Show help and command usage" do Kernel.abort to_s; end
23
23
  on "-n", "--natural" , "Sort naturally, not numerically"
24
- on "-r", "--rows <count>" , "Rows of data to select", Integer
24
+ on "-r", "--rows <count>" , "Rows of data to show", Integer
25
25
  on "-s", "--suppress" , "Suppress header when exporting delimited files"
26
26
  on "-v", "--version" , "Show version number" do Kernel.abort "#{program_name} #{@version}"; end
27
27
  on "-w", "--where <cond>" , "Where clause (eg - 'age>50 and state='AZ')"
@@ -52,9 +52,9 @@ tabl ||= ARGV.shift or abort "no table given"
52
52
  class Mysql2::Client
53
53
  alias_method :sql, :query
54
54
 
55
- def sql!(stmt, *args, **, &)
55
+ def sql!(stmt, *args, **opts, &block)
56
56
  puts "\n==[ SQL statement ]==\n\n", stmt.strip, ";"
57
- sql(stmt, *args, **, &)
57
+ sql(stmt, *args, **opts, &block)
58
58
  end
59
59
  end
60
60
 
data/bin/slyced CHANGED
@@ -11,7 +11,7 @@ dbas = nil
11
11
  tabl = nil
12
12
 
13
13
  OptionParser.new.instance_eval do
14
- @version = "1.2.1"
14
+ @version = "1.2.4"
15
15
  @banner = "usage: #{program_name} [options] <database> <table>"
16
16
 
17
17
  on "--csv" , "Output comma separated values"
@@ -21,7 +21,7 @@ OptionParser.new.instance_eval do
21
21
  on "-c", "--columns" , "Display column names and quit"
22
22
  on "-h", "--help" , "Show help and command usage" do Kernel.abort to_s; end
23
23
  on "-n", "--natural" , "Sort naturally, not numerically"
24
- on "-r", "--rows <count>" , "Rows of data to select", Integer
24
+ on "-r", "--rows <count>" , "Rows of data to show", Integer
25
25
  on "-s", "--suppress" , "Suppress header when exporting delimited files"
26
26
  on "-v", "--version" , "Show version number" do Kernel.abort "#{program_name} #{@version}"; end
27
27
  on "-w", "--where <cond>" , "Where clause (eg - 'age>50 and state='AZ')"
@@ -52,9 +52,9 @@ tabl ||= ARGV.shift or abort "no table given"
52
52
  class DuckDB::Connection
53
53
  alias_method :sql, :query
54
54
 
55
- def sql!(stmt, *args, **, &)
55
+ def sql!(stmt, *args, **opts, &block)
56
56
  puts "\n==[ SQL statement ]==\n\n", stmt.strip, ";"
57
- sql(stmt, *args, **, &)
57
+ sql(stmt, *args, **opts, &block)
58
58
  end
59
59
  end
60
60
 
data/slyce.gemspec CHANGED
@@ -12,7 +12,8 @@ Gem::Specification.new do |s|
12
12
  s.files = `git ls-files`.split("\n") - %w[.gitignore]
13
13
  s.executables = `cd bin && git ls-files .`.split("\n")
14
14
  s.add_runtime_dependency "any_ascii", "~> 0.3.2"
15
- s.add_runtime_dependency "duckdb", "~> 0.7.1"
15
+ s.add_runtime_dependency "censive", "~> 1.0.2"
16
+ s.add_runtime_dependency "duckdb", "~> 0.8.0"
16
17
  s.add_runtime_dependency "extralite-bundle", "~> 1.25"
17
18
  s.add_runtime_dependency "mysql2", "~> 0.5"
18
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slyce
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: any_ascii
@@ -24,20 +24,34 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.3.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: censive
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.0.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.0.2
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: duckdb
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: 0.7.1
47
+ version: 0.8.0
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: 0.7.1
54
+ version: 0.8.0
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: extralite-bundle
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
115
  - !ruby/object:Gem::Version
102
116
  version: '0'
103
117
  requirements: []
104
- rubygems_version: 3.4.8
118
+ rubygems_version: 3.2.33
105
119
  signing_key:
106
120
  specification_version: 4
107
121
  summary: Ruby utility to show data statistics for MySQL databases