refactor: use dialect-neutral Jet type aliases

Replace mysql/postgres intersection interfaces with mysql type aliases
per go-jet/jet#555 and generalize Apply/Expr signatures.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 17:47:56 -07:00
parent a303e025b2
commit 8053aafa6f
5 changed files with 30 additions and 40 deletions
+5 -5
View File
@@ -4,14 +4,14 @@ 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)
func NormalCols(cols ...Column) ColumnList {
res := make(ColumnList, 0)
for _, col := range cols {
switch col.(type) {
case mysql.ColumnTimestamp, // = postgres.ColumnTimestamp
mysql.ColumnTime, // = postgres.ColumnTime
mysql.ColumnDate: // = postgres.ColumnDate
case mysql.ColumnTimestamp,
mysql.ColumnTime,
mysql.ColumnDate:
default:
res = append(res, col)
}