Skip to content

Commit

Permalink
chore:update ci and readme docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yyt030 committed May 30, 2024
1 parent 24b129b commit 4d3c28c
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,11 @@ jobs:
run: |
cd applications/sveltekit
pnpm install
application-mydata:
runs-on: ubuntu-latest
steps:
- name: Build and run sample
run: |
cd applications/mydata
make && ./dist/mydata exp -h
8 changes: 2 additions & 6 deletions applications/mydata/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ LDFLAGS += -X "$(REPO)/internal/version.GitHash=$(GITHASH)"
LDFLAGS += -X "$(REPO)/internal/version.GitBranch=$(GITREF)"
LDFLAGS += -X "$(REPO)/internal/version.GoVersion=$(GOVER)"

all: gen conv mydata
all: mydata

mydata:
CGO_CFLAGS=-I$(IBM_DB_HOME)/include CGO_LDFLAGS=-L$(IBM_DB_HOME)/lib $(GOBUILD) -ldflags '$(LDFLAGS)' -o ./dist/mydata main.go
gen:
CGO_CFLAGS=-I$(IBM_DB_HOME)/include CGO_LDFLAGS=-L$(IBM_DB_HOME)/lib $(GOBUILD) -ldflags '$(LDFLAGS)' -o ./dist/gen cmd/other/genschema/gen.go
conv:
CGO_CFLAGS=-I$(IBM_DB_HOME)/include CGO_LDFLAGS=-L$(IBM_DB_HOME)/lib $(GOBUILD) -ldflags '$(LDFLAGS)' -o ./dist/conv cmd/other/conv/conv.go
$(GOBUILD) -ldflags '$(LDFLAGS)' -o ./dist/mydata main.go
42 changes: 39 additions & 3 deletions applications/mydata/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# A Fast and Flexible export data from remote mysql server

# how to use
### how to use
`go run main.go` or you can `go build -o mydata main.go && ./mydata -h`

# cmd help
### cmd help

```text
Usage:
Expand All @@ -23,4 +23,40 @@ Flags:
-h, --help help for mydata
Use "mydata [command] --help" for more information about a command.
```
```

### How to export data
pls type help:
`./mydata exp -h`

```text
Export data from remote database server
Usage:
mydata export [flags]
Aliases:
export, exp
Flags:
-a, --addr string mysql database addr, format: ip:port
-u, --username string username for connect database
-p, --password string password for connect database
-D, --dbname string default database name
-e, --query-sql string select sql
-o, --output string output filename
--fields-terminated string fields terminated (default ",")
--fields-enclosed string fields enclosed
--fields-escaped string fields escaped (default "\\")
--lines-terminated string lines terminated (default "\n")
--enclosed-optionally fields enclosed optionally
--params string connection Params (default "timeout=3s")
--buf-size int buf size for write outfile (default 32768)
--concurrency int concurrency number (default 5)
--not-merge merge chunks to one file
```
### example
export data by `select * from bigdata` from 127.0.0.1
```shell
./mydata exp -a 127.0.0.1:3306 -u username@tenant#clustername:clusterid -p xxx -D test -e "select * from bigdata" -o bigdata
```

0 comments on commit 4d3c28c

Please sign in to comment.