Skip to content

Commit

Permalink
Release v1.17.6-pr.1
Browse files Browse the repository at this point in the history
Update the version of github.com/urfave/cli to v2.
  • Loading branch information
mithrandie committed Jun 28, 2022
2 parents e7cfefd + 5c93221 commit 441d33f
Show file tree
Hide file tree
Showing 58 changed files with 3,299 additions and 2,261 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/coverage_profile_uploading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ on:
workflow_run:
workflows:
- Test
branches:
- master
- develop
types:
- completed
branches:
- master

jobs:
upload:
Expand All @@ -32,7 +31,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.txt
fail_ci_if_error: true
verbose: true
verbose: false
fail:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,30 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: 1.x

- name: Build
run: |
make build-all
make dist
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body: |
${{ github.event.head_commit.message }}
draft: false
prerelease: false

- name: Upload Release Assets
id: upload-release-assets
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./dist/*.tar.gz
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Change Log

## Version 1.17.5

Released on Jun 26, 2022

- Fix a bug of the CASE expression. ([GitHub #78](https://github.com/mithrandie/csvq/issues/78))

## Version 1.17.4

Released on Jun 25, 2022

- Add the IF NOT EXISTS clause to the syntax of the CREATE TABLE statement. ([GitHub #77](https://github.com/mithrandie/csvq/issues/77))

## Version 1.17.3

Released on Jun 19, 2022

- Set the default format to csv when the output is piped. ([GitHub #71](https://github.com/mithrandie/csvq/issues/71))

## Version 1.17.1

Released on Jun 17, 2022
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ GOPATH := $(shell pwd)/build
BINARY := csvq
RELEASE_ARCH := darwin/amd64 darwin/arm64 linux/amd64 linux/386 linux/arm linux/arm64 freebsd/amd64 freebsd/386 freebsd/arm netbsd/amd64 netbsd/386 netbsd/arm openbsd/amd64 openbsd/386 windows/amd64 windows/386
PRERELEASE_ARCH := darwin/amd64 darwin/arm64 linux/amd64 windows/amd64
BUILD_TAGS := -tags urfave_cli_no_docs

ifneq ($(shell command -v git && git remote -v 2>/dev/null | grep mithrandie/csvq.git && echo true),true)
VERSION := $(shell git describe --tags --always 2>/dev/null)
Expand All @@ -19,11 +20,11 @@ $(BINARY): build

.PHONY: build
build:
go build -trimpath $(LDFLAGS) -o $(GOPATH)/bin/
go build $(BUILD_TAGS) -trimpath $(LDFLAGS) -o $(GOPATH)/bin/

.PHONY: install
install:
go install $(LDFLAGS)
go install $(BUILD_TAGS) -trimpath $(LDFLAGS)

.PHONY: clean
clean:
Expand All @@ -35,7 +36,7 @@ build-all:
for TARGET in $(RELEASE_ARCH); \
do \
set -- $$TARGET; \
GOOS=$$1 GOARCH=$$2 go build -trimpath $(LDFLAGS) -o "dist/$(BINARY)-$(VERSION)-$${1}-$${2}/"; \
GOOS=$$1 GOARCH=$$2 go build $(BUILD_TAGS) -trimpath $(LDFLAGS) -o "dist/$(BINARY)-$(VERSION)-$${1}-$${2}/"; \
done

.PHONY: build-pre-release
Expand All @@ -44,7 +45,7 @@ build-pre-release:
for TARGET in $(PRERELEASE_ARCH); \
do \
set -- $$TARGET; \
GOOS=$$1 GOARCH=$$2 go build -trimpath $(LDFLAGS) -o "dist/$(BINARY)-$(VERSION)-$${1}-$${2}/"; \
GOOS=$$1 GOARCH=$$2 go build $(BUILD_TAGS) -trimpath $(LDFLAGS) -o "dist/$(BINARY)-$(VERSION)-$${1}-$${2}/"; \
done

.PHONY: dist -
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ You can read, update, delete CSV records with SQL-like query.
You can also execute multiple operations sequentially in managed transactions by passing a procedure or using the interactive shell.
In the multiple operations, you can use variables, cursors, temporary tables, and other features.

## Latest Release
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/mithrandie/csvq?color=%2320b2aa&label=GitHub%20Release&sort=semver)](https://github.com/mithrandie/csvq/releases/latest)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/qittu/csvq-deb?color=%2320b2aa&label=Launchpad%20PPA)](https://launchpad.net/~mithrandie/+archive/ubuntu/csvq)

## Features

Expand Down
9 changes: 7 additions & 2 deletions docs/_posts/2006-01-02-create-table-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Create Table query is used to create new csv files.
## Create Empty Table

```sql
CREATE TABLE file_path (column_name [, column_name ...])
CREATE TABLE [IF NOT EXISTS] file_path (column_name [, column_name ...])
```

_file_path_
Expand All @@ -20,11 +20,13 @@ _file_path_
_column_name_
: [identifier]({{ '/reference/statement.html#parsing' | relative_url }})

If the _IF NOT EXISTS_ clause is specified and the file already exists, no operation is performed.
In this case, an error is raised if the specified columns are different from the existing file.

## Create from the Result-Set of a Select Query

```sql
CREATE TABLE file_path [(column_name [, column_name ...])] [AS] select_query
CREATE TABLE [IF NOT EXISTS] file_path [(column_name [, column_name ...])] [AS] select_query
```

_file_path_
Expand All @@ -35,3 +37,6 @@ _column_name_

_select_query_
: [Select Query]({{ '/reference/select-query.html' | relative_url }})

If the _IF NOT EXISTS_ clause is specified and the file already exists, no operation is performed.
In this case, an error is raised if the specified columns are different from the existing file.
18 changes: 18 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ title: Change Log - csvq

# Change Log

## Version 1.17.5

Released on Jun 26, 2022

- Fix a bug of the CASE expression. ([GitHub #78](https://github.com/mithrandie/csvq/issues/78))

## Version 1.17.4

Released on Jun 25, 2022

- Add the IF NOT EXISTS clause to the syntax of the CREATE TABLE statement. ([GitHub #77](https://github.com/mithrandie/csvq/issues/77))

## Version 1.17.3

Released on Jun 19, 2022

- Set the default format to csv when the output is piped. ([GitHub #71](https://github.com/mithrandie/csvq/issues/71))

## Version 1.17.1

Released on Jun 17, 2022
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ In the multiple operations, you can use variables, cursors, temporary tables, an

## Latest Release

Version 1.17.1
: Released on Jun 17, 2022
Version 1.17.5
: Released on Jun 26, 2022

<a class="waves-effect waves-light btn" href="https://github.com/mithrandie/csvq/releases/tag/v1.17.1">
<a class="waves-effect waves-light btn" href="https://github.com/mithrandie/csvq/releases/tag/v1.17.5">
<i class="material-icons left">file_download</i>download
</a>

Expand Down
6 changes: 3 additions & 3 deletions docs/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://mithrandie.github.io/csvq/</loc>
<lastmod>2022-06-17T12:34:27+00:00</lastmod>
<lastmod>2022-06-26T02:35:14+00:00</lastmod>
</url>
<url>
<loc>https://mithrandie.github.io/csvq/reference.html</loc>
Expand Down Expand Up @@ -50,7 +50,7 @@
</url>
<url>
<loc>https://mithrandie.github.io/csvq/reference/create-table-query.html</loc>
<lastmod>2017-08-23T18:02:56+00:00</lastmod>
<lastmod>2022-06-25T12:50:11+00:00</lastmod>
</url>
<url>
<loc>https://mithrandie.github.io/csvq/reference/alter-table-query.html</loc>
Expand Down Expand Up @@ -178,7 +178,7 @@
</url>
<url>
<loc>https://mithrandie.github.io/csvq/changelog.html</loc>
<lastmod>2022-06-17T12:34:27+00:00</lastmod>
<lastmod>2022-06-26T02:35:14+00:00</lastmod>
</url>
<url>
<loc>https://mithrandie.github.io/csvq/license.html</loc>
Expand Down
9 changes: 7 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ require (
github.com/mithrandie/go-text v1.5.3
github.com/mithrandie/readline-csvq v1.2.0
github.com/mithrandie/ternary v1.1.1
github.com/urfave/cli v1.20.0
github.com/urfave/cli/v2 v2.10.3
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c
golang.org/x/text v0.3.7
)

require golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
)

go 1.17
13 changes: 11 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0=
github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mithrandie/go-file/v2 v2.1.0 h1:XA5Tl+73GXMDvgwSE3Sg0uC5FkLr3hnXs8SpUas0hyg=
Expand All @@ -8,8 +11,12 @@ github.com/mithrandie/readline-csvq v1.2.0 h1:5GFbdWFP+2m57Yz+XLtKVIfyH0SjN9du51
github.com/mithrandie/readline-csvq v1.2.0/go.mod h1:6Grnfrl8PHC448fV7f8RJNlHeoM+Z3w2QlYW+J9mA2I=
github.com/mithrandie/ternary v1.1.1 h1:k/joD6UGVYxHixYmSR8EGgDFNONBMqyD373xT4QRdC4=
github.com/mithrandie/ternary v1.1.1/go.mod h1:0D9Ba3+09K2TdSZO7/bFCC0GjSXetCvYuYq0u8FY/1g=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/urfave/cli/v2 v2.10.3 h1:oi571Fxz5aHugfBAJd5nkwSk3fzATXtMlpxdLylSCMo=
github.com/urfave/cli/v2 v2.10.3/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
Expand All @@ -24,3 +31,5 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
5 changes: 3 additions & 2 deletions lib/action/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
csvqfile "github.com/mithrandie/csvq/lib/file"
"github.com/mithrandie/csvq/lib/parser"
"github.com/mithrandie/csvq/lib/query"
"github.com/mithrandie/csvq/lib/terminal"

"github.com/mithrandie/go-file/v2"
)
Expand Down Expand Up @@ -65,11 +66,11 @@ func LaunchInteractiveShell(ctx context.Context, proc *query.Processor) error {
return query.NewIncorrectCommandUsageError("input from pipe or redirection cannot be used in interactive shell")
}

if err := proc.Tx.Session.SetStdin(query.GetStdinForREPL()); err != nil {
if err := proc.Tx.Session.SetStdin(terminal.GetStdinForREPL()); err != nil {
return query.NewIOError(nil, err.Error())
}

term, err := query.NewTerminal(ctx, proc.ReferenceScope)
term, err := terminal.NewTerminal(ctx, proc.ReferenceScope)
if err != nil {
return query.ConvertLoadConfigurationError(err)
}
Expand Down
Loading

0 comments on commit 441d33f

Please sign in to comment.