Parcourir la source

添加通用语句

yjp il y a 1 an
Parent
commit
fceb00dbfc
1 fichiers modifiés avec 21 ajouts et 0 suppressions
  1. 21 0
      framework/core/infrastructure/database/clause/common.go

+ 21 - 0
framework/core/infrastructure/database/clause/common.go

@@ -0,0 +1,21 @@
+package clause
+
+type CommonClause struct {
+	clause string
+	args   []any
+}
+
+func NewCommonClause(clause string, args ...any) CommonClause {
+	return CommonClause{
+		clause: clause,
+		args:   args,
+	}
+}
+
+func (clause CommonClause) Clause() (string, error) {
+	return string(clause.clause + "\n"), nil
+}
+
+func (clause CommonClause) Args() []any {
+	return clause.args
+}