Skip to content

Commit

Permalink
Merge branch 'master' of githubjason.com:verytalk/export-select-to-in…
Browse files Browse the repository at this point in the history
…sert-golang
  • Loading branch information
jasondayee committed Feb 19, 2021
2 parents 4c5f1e0 + 01b9b26 commit bf872a3
Showing 1 changed file with 57 additions and 3 deletions.
60 changes: 57 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,64 @@
# export-select-to-insert-golang


go run main.go config test.yaml
#### How to use

go build main.go
> clone project
```
git@github.com:verytalk/export-select-to-insert-golang.git
```


> Linux
- edit config file config.yaml
- running the file main For example:

```
./main
```

> Other execution ways
- Install golang environment
- running script main.go For example

```
go run main.go
```


> If you don't want to use the default config file config.yaml
```
./main --config test.yaml
or
go run main.go --config test.yaml
```

> Explain config file
```
mysql:
user : root # mysql user
password : root # mysql password
host : 127.0.0.1 # mysql host
port : 3306 # mysql port
name : test # mysql database name
logfile:
filename: Logs.sql # export SQL to the filename
export:
tableName: Logs # generate insert to table
exportSQL: SELECT * FROM Logs # SELECT statement
exportOpenPaging: true # using paging true/false
exportPagingStart: 0 # start page
exportPagingEnd: 400 # end page
exportPagingLimit: 20000 # length per page
```

GO111MODULE=on go run main.go -config test.yaml


0 comments on commit bf872a3

Please sign in to comment.