slyce 1.2.0 → 1.2.3

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 +1 -0
  6. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88c8c083ec80e6f7e25a3ba665a4bc9ec578b0f7d3939298b4ce97a1a13c430d
4
- data.tar.gz: 0a4af788b109e4b8f000d304c53d7d1ad2b090545eca213bf9f7901cc40b1188
3
+ metadata.gz: e72a59210f1f21f2bbc06e074286c16fe8d2482ef6ca880282d37b043e8e0218
4
+ data.tar.gz: feebfbf2c252cd8f0ed52825db7da5caf585242ae6d3d54af3da9fec7ad5f4e8
5
5
  SHA512:
6
- metadata.gz: 285327c0dba3c36a4c3da6ff0fa033589094ea8a72b2ffe49fe7370d2c89d137835e2aa60f7e0c40a4449f823e55434166b93fcc14c8bc39d431814a9d38b092
7
- data.tar.gz: 78737aefd1bca2982594a175c8ee2ae49a5040b12e80382b57a792df3040789400cc747f6d19ab68eaa88c29a2341d2b679b4e895bf622a5b6df1039b5d0b5f6
6
+ metadata.gz: 2048384fee8c32a7e71f6d6ab6ee1e7155166dd293942c01eef432415f97504f8c98ed06d922fbe6f731c5c3e1bd7a819f51f5e4745124260f512d076041cdd4
7
+ data.tar.gz: 87672286c289db6595f8395fdee61b4f438729bf090c8667f715cf67b6025823302a4202c714f3ea54ce298f76d0263b0423d2b497f8e78e8153fefe55281f63
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.0"
14
+ @version = "1.2.3"
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.0"
14
+ @version = "1.2.3"
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,6 +12,7 @@ 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.8.0"
15
16
  s.add_runtime_dependency "extralite-bundle", "~> 1.25"
16
17
  s.add_runtime_dependency "mysql2", "~> 0.5"
17
18
  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.0
4
+ version: 1.2.3
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,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.3.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: duckdb
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.8.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: extralite-bundle
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -87,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
101
  - !ruby/object:Gem::Version
88
102
  version: '0'
89
103
  requirements: []
90
- rubygems_version: 3.4.8
104
+ rubygems_version: 3.2.33
91
105
  signing_key:
92
106
  specification_version: 4
93
107
  summary: Ruby utility to show data statistics for MySQL databases