feat: add support for 南大通用(GBASE) GBase8s database
This commit is contained in:
parent
f50aacd38b
commit
e930396f66
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
|
||||
}
|
||||
}
|
||||
} 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 {
|
||||
if _, err = io.WriteString(w, "'"+strings.ReplaceAll(s.String, "'", "''")+"'"); err != nil {
|
||||
return err
|
||||
|
|
|
@ -23,6 +23,7 @@ const (
|
|||
MSSQL DBType = "mssql"
|
||||
ORACLE DBType = "oracle"
|
||||
DAMENG DBType = "dameng"
|
||||
GBASE8S DBType = "gbase8s"
|
||||
)
|
||||
|
||||
// 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 {
|
||||
if engine.dialect.URI().DBType == schemas.POSTGRES ||
|
||||
engine.dialect.URI().DBType == schemas.GBASE8S ||
|
||||
engine.dialect.URI().DBType == schemas.MYSQL {
|
||||
_, err = session.exec(engine.dialect.ModifyColumnSQL(tbNameWithSchema, col))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue