feat: add delete, context, and tx helpers

Add Delete/DeleteAffected, context-aware CRUD helpers, WithTx, ContainsCol,
and queryReturning deduplication for returning statements.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-29 17:49:57 -07:00
parent 8053aafa6f
commit 8d697eda5b
11 changed files with 517 additions and 23 deletions
+10 -1
View File
@@ -1,6 +1,15 @@
package dbx
import "github.com/go-jet/jet/v2/mysql"
import (
"slices"
"github.com/go-jet/jet/v2/mysql"
)
// ContainsCol reports whether cols contains col.
func ContainsCol(cols ColumnList, col Column) bool {
return slices.Contains(cols, col)
}
// NormalCols processes a list of columns and strips out any that implement any of
// ColumnTimestamp, ColumnTime, or ColumnDate.