Jelajahi Sumber

添加通用语句

yjp 1 tahun lalu
induk
melakukan
fceb00dbfc
1 mengubah file dengan 21 tambahan dan 0 penghapusan
  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
+}