refactor: split dbx package into domain files
Reorganize monolithic dbx.go and utility.go into focused files by concern, add package doc.go, and gitignore coverage.out. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package dbx
|
||||
|
||||
import "github.com/go-jet/jet/v2/mysql"
|
||||
|
||||
// NormalCols processes a list of columns and strips out any that implement any of
|
||||
// ColumnTimestamp, ColumnTime, or ColumnDate.
|
||||
func NormalCols[CL ColumnList](cols ...Column) CL {
|
||||
res := make(CL, 0)
|
||||
|
||||
for _, col := range cols {
|
||||
switch col.(type) {
|
||||
case mysql.ColumnTimestamp, // = postgres.ColumnTimestamp
|
||||
mysql.ColumnTime, // = postgres.ColumnTime
|
||||
mysql.ColumnDate: // = postgres.ColumnDate
|
||||
default:
|
||||
res = append(res, col)
|
||||
}
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user