patch model&rpc (#207)

* change column to read from information_schema

* reactor generate mode from datasource

* reactor generate mode from datasource

* add primary key check logic

* resolve rebase conflicts

* add naming style

* add filename test case

* resolve rebase conflicts

* reactor test

* add test case

* change shell script to makefile

* update rpc new

* update gen_test.go

* format code

* format code

* update test

* generates alias
This commit is contained in:
Keson
2020-11-18 15:32:53 +08:00
committed by GitHub
parent 71083b5e64
commit 24fb29a356
55 changed files with 674 additions and 1163 deletions

View File

@@ -4,11 +4,10 @@ import (
"regexp"
)
func (g *defaultGenerator) split() []string {
func (g *defaultGenerator) split(source string) []string {
reg := regexp.MustCompile(createTableFlag)
index := reg.FindAllStringIndex(g.source, -1)
index := reg.FindAllStringIndex(source, -1)
list := make([]string, 0)
source := g.source
for i := len(index) - 1; i >= 0; i-- {
subIndex := index[i]
if len(subIndex) == 0 {