Merge branch 'v1' into lunny/fix_bug_longtext_with_json
This commit is contained in:
commit
e1ae4ff968
|
@ -50,6 +50,9 @@ Drivers for Go's sql package which currently support database/sql includes:
|
||||||
* MsSql
|
* MsSql
|
||||||
- [github.com/microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb)
|
- [github.com/microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb)
|
||||||
|
|
||||||
|
* GBase8s
|
||||||
|
- [https://gitee.com/GBase8s/go-gci](https://gitee.com/GBase8s/go-gci)
|
||||||
|
|
||||||
* Oracle
|
* Oracle
|
||||||
- [github.com/godror/godror](https://github.com/godror/godror) (experiment)
|
- [github.com/godror/godror](https://github.com/godror/godror) (experiment)
|
||||||
- [github.com/mattn/go-oci8](https://github.com/mattn/go-oci8) (experiment)
|
- [github.com/mattn/go-oci8](https://github.com/mattn/go-oci8) (experiment)
|
||||||
|
|
|
@ -49,6 +49,9 @@ v1.0.0 相对于 v0.8.2 有以下不兼容的变更:
|
||||||
* MsSql
|
* MsSql
|
||||||
- [github.com/microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb)
|
- [github.com/microsoft/go-mssqldb](https://github.com/microsoft/go-mssqldb)
|
||||||
|
|
||||||
|
* GBase8s
|
||||||
|
- [https://gitee.com/GBase8s/go-gci](https://gitee.com/GBase8s/go-gci)
|
||||||
|
|
||||||
* Oracle
|
* Oracle
|
||||||
- [github.com/godror/godror](https://github.com/godror/godror) (试验性支持)
|
- [github.com/godror/godror](https://github.com/godror/godror) (试验性支持)
|
||||||
- [github.com/mattn/go-oci8](https://github.com/mattn/go-oci8) (试验性支持)
|
- [github.com/mattn/go-oci8](https://github.com/mattn/go-oci8) (试验性支持)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
16
engine.go
16
engine.go
|
@ -798,6 +798,22 @@ func (engine *Engine) dumpTables(ctx context.Context, tables []*schemas.Table, w
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if sess.engine.dialect.URI().DBType == schemas.GBASE8S {
|
||||||
|
stp.Name = strings.Replace(stp.Name, "SQLT_", "", 1)
|
||||||
|
if stp.IsTime() && len(s.String) == 20 { // "2025-06-10T07:55:31Z"
|
||||||
|
t, err := time.Parse(time.RFC3339, s.String)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("failed to parse time %s: %v", s.String, err)
|
||||||
|
}
|
||||||
|
r := t.Format("2006-01-02 15:04:05")
|
||||||
|
if _, err = io.WriteString(w, "'"+r+"'"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if _, err = io.WriteString(w, "'"+strings.ReplaceAll(s.String, "'", "''")+"'"); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if _, err = io.WriteString(w, "'"+strings.ReplaceAll(s.String, "'", "''")+"'"); err != nil {
|
if _, err = io.WriteString(w, "'"+strings.ReplaceAll(s.String, "'", "''")+"'"); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -23,6 +23,7 @@ const (
|
||||||
MSSQL DBType = "mssql"
|
MSSQL DBType = "mssql"
|
||||||
ORACLE DBType = "oracle"
|
ORACLE DBType = "oracle"
|
||||||
DAMENG DBType = "dameng"
|
DAMENG DBType = "dameng"
|
||||||
|
GBASE8S DBType = "gbase8s"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SQLType represents SQL types
|
// SQLType represents SQL types
|
||||||
|
|
1
sync.go
1
sync.go
|
@ -196,6 +196,7 @@ func (session *Session) SyncWithOptions(opts SyncOptions, beans ...interface{})
|
||||||
}
|
}
|
||||||
} else if col.Comment != oriCol.Comment {
|
} else if col.Comment != oriCol.Comment {
|
||||||
if engine.dialect.URI().DBType == schemas.POSTGRES ||
|
if engine.dialect.URI().DBType == schemas.POSTGRES ||
|
||||||
|
engine.dialect.URI().DBType == schemas.GBASE8S ||
|
||||||
engine.dialect.URI().DBType == schemas.MYSQL {
|
engine.dialect.URI().DBType == schemas.MYSQL {
|
||||||
_, err = session.exec(engine.dialect.ModifyColumnSQL(tbNameWithSchema, col))
|
_, err = session.exec(engine.dialect.ModifyColumnSQL(tbNameWithSchema, col))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue