mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	!124 一些更新和bug
* fix: 代码合并 * feat:支持数据库版本兼容,目前兼容了oracle11g部分特性 * fix: 修改数据同步bug,数据sql里指定修改字段别,导致未正确记录修改字段值 * feat: 数据库迁移支持定时迁移和迁移到sql文件
This commit is contained in:
		@@ -15,22 +15,22 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	meta := new(PostgresMeta)
 | 
			
		||||
	meta := new(Meta)
 | 
			
		||||
	dbi.Register(dbi.DbTypePostgres, meta)
 | 
			
		||||
	dbi.Register(dbi.DbTypeKingbaseEs, meta)
 | 
			
		||||
	dbi.Register(dbi.DbTypeVastbase, meta)
 | 
			
		||||
 | 
			
		||||
	gauss := &PostgresMeta{
 | 
			
		||||
	gauss := &Meta{
 | 
			
		||||
		Param: "dbtype=gauss",
 | 
			
		||||
	}
 | 
			
		||||
	dbi.Register(dbi.DbTypeGauss, gauss)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type PostgresMeta struct {
 | 
			
		||||
type Meta struct {
 | 
			
		||||
	Param string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (pm *PostgresMeta) GetSqlDb(d *dbi.DbInfo) (*sql.DB, error) {
 | 
			
		||||
func (pm *Meta) GetSqlDb(d *dbi.DbInfo) (*sql.DB, error) {
 | 
			
		||||
	driverName := "postgres"
 | 
			
		||||
	// SSH Conect
 | 
			
		||||
	if d.SshTunnelMachineId > 0 {
 | 
			
		||||
@@ -81,11 +81,11 @@ func (pm *PostgresMeta) GetSqlDb(d *dbi.DbInfo) (*sql.DB, error) {
 | 
			
		||||
	return sql.Open(driverName, dsn)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (pm *PostgresMeta) GetDialect(conn *dbi.DbConn) dbi.Dialect {
 | 
			
		||||
func (pm *Meta) GetDialect(conn *dbi.DbConn) dbi.Dialect {
 | 
			
		||||
	return &PgsqlDialect{dc: conn}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (pm *PostgresMeta) GetMetaData(conn *dbi.DbConn) *dbi.MetaDataX {
 | 
			
		||||
func (pm *Meta) GetMetaData(conn *dbi.DbConn) *dbi.MetaDataX {
 | 
			
		||||
	return dbi.NewMetaDataX(&PgsqlMetaData{dc: conn})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user