Skip to content

Commit

Permalink
Merge pull request #6 from noborus/update-github-actions
Browse files Browse the repository at this point in the history
Updated each version of github actions
  • Loading branch information
noborus authored Nov 17, 2023
2 parents de6cd4c + 70ec9cb commit 94449b8
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
go-version: [ 'stable', 'oldstable' ]
name: Go ${{ matrix.go-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
id: go
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
14 changes: 13 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ archives:
- format: tar.gz
# this name template makes the OS and Arch compatible with the results of uname.
name_template: >-
{{ .ProjectName }}_
{{ .ProjectName }}_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
Expand Down Expand Up @@ -57,6 +57,18 @@ brews:
email: noborusai@gmail.com
homepage: https://github.com/noborus/mdtsql
description: "Execute SQL to markdown table and convert to other format"

nfpms:
-
package_name: mdtsql
homepage: "https://github.com/noborus/mdtsql"
maintainer: "Noboru Saito <noborusai@gmail.com>"
description: "Execute SQL to markdown table and convert to other format"
license: "MIT"
formats:
- deb
- rpm

# modelines, feel free to remove those if you don't want/use them:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
# mdtsql

Execute SQL to markdown table and convert to other format
A CLI tool that executes SQL queries and converts the results into a Markdown table.

## install

### Go install

```console
go install github.com/noborus/mdtsql/cmd/mdtsql@latest
```

### Homebrew

```console
brew install noborus/tap/mdtsql
```

## Usage

Executes SQL for markdown containing table.
Expand All @@ -22,22 +30,22 @@ mdtsql [option] [markdown file]
```sh
mdtsql -h
Execute SQL for table in markdown.
The result can be output to CSV, JSON, LTSV, Markdwon, etc.
The result can be output to CSV, JSON, LTSV, YAML, Markdown, etc.

Usage:
mdtsql [flags]

Flags:
-d, --Delimiter string output delimiter (CSV only) (default ",")
-O, --Header output header (CSV only)
-o, --OutFormat string output format=at|csv|ltsv|json|jsonl|tbln|raw|md|vf (default "md")
-c, --caption caption table name
--config string config file (default is $HOME/.mdtsql.yaml)
--debug debug print
-h, --help help for mdtsql
-q, --query string SQL query
-t, --toggle Help message for toggle
-v, --version display version information
-d, --Delimiter string output delimiter (CSV only) (default ",")
-O, --Header output header (CSV only)
-o, --OutFormat string output format[CSV|AT|LTSV|JSON|JSONL|TBLN|RAW|MD|VF|YAML] (default "MD")
-c, --caption caption table name
--completion string Generate completion script for the specified shell. The options are 'bash', 'zsh', 'fish', and 'powershell'.
--config string config file (default is $HOME/.mdtsql.yaml)
--debug debug print
-h, --help help for mdtsql
-q, --query string SQL query
-v, --version display version information
```
### Example
Expand Down Expand Up @@ -76,7 +84,7 @@ If there is no `--query` or `-q` option,
analyze the markdown file and output the table information.
```sh
mdsql abc.md
mdtsql abc.md
Table Name: [abc]
+-------------+------+
| column name | type |
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/jwalton/gchalk v1.3.0 // indirect
github.com/jwalton/go-supportscolor v1.2.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/klauspost/compress v1.17.3 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down Expand Up @@ -63,7 +63,7 @@ require (
lukechampine.com/uint128 v1.3.0 // indirect
modernc.org/cc/v3 v3.41.0 // indirect
modernc.org/ccgo/v3 v3.16.15 // indirect
modernc.org/libc v1.34.0 // indirect
modernc.org/libc v1.34.4 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.7.2 // indirect
modernc.org/opt v0.1.3 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ github.com/jwalton/go-supportscolor v1.2.0/go.mod h1:hFVUAZV2cWg+WFFC4v8pT2X/S2q
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4=
github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
Expand Down Expand Up @@ -585,8 +585,8 @@ modernc.org/ccgo/v3 v3.16.15 h1:KbDR3ZAVU+wiLyMESPtbtE/Add4elztFyfsWoNTgxS0=
modernc.org/ccgo/v3 v3.16.15/go.mod h1:yT7B+/E2m43tmMOT51GMoM98/MtHIcQQSleGnddkUNI=
modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk=
modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM=
modernc.org/libc v1.34.0 h1:akq7OQDN7YSoBvTdmaIv3p8RtzAqreMSQxF9u0KHaM4=
modernc.org/libc v1.34.0/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE=
modernc.org/libc v1.34.4 h1:r9+5s4wNeoCsB8CuJE67UB4N07ernbvrcry9O3MLWtQ=
modernc.org/libc v1.34.4/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE=
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo=
modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E=
Expand Down

0 comments on commit 94449b8

Please sign in to comment.