Skip to content

Commit

Permalink
v1.3.6: fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mizuki1412 committed Apr 2, 2022
1 parent bf9d09f commit 84cac73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion service/sqlkit/pghelper/common_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

func CheckSchemaExist(schema string) bool {
dao := &sqlkit.Dao[any]{}
dao.NewHelper("")
rows := dao.Query(fmt.Sprintf("SELECT EXISTS(SELECT 1 FROM pg_namespace WHERE nspname = '%s')", schema))
defer rows.Close()
for rows.Next() {
Expand Down
10 changes: 7 additions & 3 deletions service/sqlkit/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,10 @@ func (dao *Dao[T]) ScanList(sql string, args []any) []*T {
}
list = append(list, m)
}
for i := range list {
dao.Cascade(list[i])
if dao.Cascade != nil {
for i := range list {
dao.Cascade(list[i])
}
}
return list
}
Expand All @@ -413,7 +415,9 @@ func (dao *Dao[T]) ScanOne(sql string, args []any) *T {
if err != nil {
panic(exception.New(err.Error()))
}
dao.Cascade(m)
if dao.Cascade != nil {
dao.Cascade(m)
}
return m
}
return nil
Expand Down

0 comments on commit 84cac73

Please sign in to comment.