Skip to content

Commit

Permalink
feat: Update CLI with newer API createOrUpdateCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
JigarJoshi authored and efirs committed Apr 12, 2022
1 parent 0203ca3 commit 0fe982c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/go-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup SSH deploy keys
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: |
${{ secrets.CLIENT_DEPLOY_KEY }}
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
Expand Down
4 changes: 2 additions & 2 deletions cmd/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ var createCollectionCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
ctx, cancel := util.GetContext(cmd.Context())
defer cancel()
err := client.Get().CreateCollection(ctx, args[0], args[1], driver.Schema(args[2]), &driver.CollectionOptions{})
err := client.Get().CreateOrUpdateCollection(ctx, args[0], args[1], driver.Schema(args[2]), &driver.CollectionOptions{})
if err != nil {
log.Fatal().Err(err).Msg("create collection failed")
}
Expand Down Expand Up @@ -74,7 +74,7 @@ var alterCollectionCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
ctx, cancel := util.GetContext(cmd.Context())
defer cancel()
err := client.Get().AlterCollection(ctx, args[0], args[1], driver.Schema(args[2]), &driver.CollectionOptions{})
err := client.Get().CreateOrUpdateCollection(ctx, args[0], args[1], driver.Schema(args[2]), &driver.CollectionOptions{})
if err != nil {
log.Fatal().Err(err).Msg("alter collection failed")
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var readCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
ctx, cancel := util.GetContext(cmd.Context())
defer cancel()
it, err := client.Get().Read(ctx, args[0], args[1], driver.Filter(args[2]), &driver.ReadOptions{})
it, err := client.Get().Read(ctx, args[0], args[1], driver.Filter(args[2]), driver.Fields{}, &driver.ReadOptions{})
if err != nil {
log.Fatal().Err(err).Msg("read documents failed")
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.1
github.com/tigrisdata/tigrisdb-client-go v1.0.0-alpha.2
github.com/tigrisdata/tigrisdb-client-go v1.0.0-alpha.4
gopkg.in/yaml.v2 v2.4.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/tigrisdata/tigrisdb-client-go v1.0.0-alpha.2 h1:2+dp45BHwPf48pDb0s8nZfyUKjueVDQMTd2lEx7TcF4=
github.com/tigrisdata/tigrisdb-client-go v1.0.0-alpha.2/go.mod h1:lP4RhNml4kRHULYY+nb+nmvGz0THlwUx9w5BI7Qus7I=
github.com/tigrisdata/tigrisdb-client-go v1.0.0-alpha.4 h1:bxmxXRVzsD9vGlFgfpMe1WtWB0wzUV2rE66ir7wacdY=
github.com/tigrisdata/tigrisdb-client-go v1.0.0-alpha.4/go.mod h1:lP4RhNml4kRHULYY+nb+nmvGz0THlwUx9w5BI7Qus7I=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
Expand Down

0 comments on commit 0fe982c

Please sign in to comment.