slyce 1.2.1 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -2
- data/bin/slyce +4 -4
- data/bin/slyced +4 -4
- data/slyce.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e72a59210f1f21f2bbc06e074286c16fe8d2482ef6ca880282d37b043e8e0218
|
4
|
+
data.tar.gz: feebfbf2c252cd8f0ed52825db7da5caf585242ae6d3d54af3da9fec7ad5f4e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
44
|
+
The executable is called `slyced`. It requires the `duckdb` gem, which can be installed with:
|
14
45
|
|
15
|
-
|
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.
|
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
|
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.
|
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
|
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,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.
|
15
|
+
s.add_runtime_dependency "duckdb", "~> 0.8.0"
|
16
16
|
s.add_runtime_dependency "extralite-bundle", "~> 1.25"
|
17
17
|
s.add_runtime_dependency "mysql2", "~> 0.5"
|
18
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.
|
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-
|
11
|
+
date: 2023-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: any_ascii
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.8.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.8.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: extralite-bundle
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
rubygems_version: 3.
|
104
|
+
rubygems_version: 3.2.33
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Ruby utility to show data statistics for MySQL databases
|