-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55672eb
commit f76fe82
Showing
9 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
package psql | ||
|
||
import ( | ||
"github.com/rrgmc/litsql" | ||
"github.com/rrgmc/litsql/dialect/psql/tag" | ||
"github.com/rrgmc/litsql/internal/idm" | ||
) | ||
|
||
func Delete(mods ...DeleteMod) DeleteQuery { | ||
return idm.Delete[tag.DeleteTag](Dialect, mods...) | ||
} | ||
|
||
func DeleteRaw(rawQuery string, args ...any) DeleteQuery { | ||
return Delete(idm.RawQuery[tag.DeleteTag](rawQuery, args...)) | ||
} | ||
|
||
func DeleteRawExpr(e litsql.Expression) DeleteQuery { | ||
return Delete(idm.RawQueryExpr[tag.DeleteTag](e)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
package psql | ||
|
||
import ( | ||
"github.com/rrgmc/litsql" | ||
"github.com/rrgmc/litsql/dialect/psql/tag" | ||
"github.com/rrgmc/litsql/internal/iim" | ||
"github.com/rrgmc/litsql/internal/ism" | ||
) | ||
|
||
func Insert(mods ...InsertMod) InsertQuery { | ||
return iim.Insert[tag.InsertTag](Dialect, mods...) | ||
} | ||
|
||
func InsertRaw(rawQuery string, args ...any) InsertQuery { | ||
return Insert(ism.RawQuery[tag.InsertTag](rawQuery, args...)) | ||
} | ||
|
||
func InsertRawExpr(e litsql.Expression) InsertQuery { | ||
return Insert(ism.RawQueryExpr[tag.InsertTag](e)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
package psql | ||
|
||
import ( | ||
"github.com/rrgmc/litsql" | ||
"github.com/rrgmc/litsql/dialect/psql/tag" | ||
"github.com/rrgmc/litsql/internal/ism" | ||
"github.com/rrgmc/litsql/internal/ium" | ||
) | ||
|
||
func Update(mods ...UpdateMod) UpdateQuery { | ||
return ium.Update[tag.UpdateTag](Dialect, mods...) | ||
} | ||
|
||
func UpdateRaw(rawQuery string, args ...any) UpdateQuery { | ||
return Update(ism.RawQuery[tag.UpdateTag](rawQuery, args...)) | ||
} | ||
|
||
func UpdateRawExpr(e litsql.Expression) UpdateQuery { | ||
return Update(ism.RawQueryExpr[tag.UpdateTag](e)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package idm | ||
|
||
import ( | ||
"github.com/rrgmc/litsql" | ||
"github.com/rrgmc/litsql/expr" | ||
"github.com/rrgmc/litsql/internal/iclause" | ||
"github.com/rrgmc/litsql/sq" | ||
) | ||
|
||
func RawQuery[T any](rawQuery string, args ...any) sq.QueryMod[T] { | ||
return sq.QueryModFunc[T](func(a litsql.QueryBuilder) { | ||
a.AddQueryClause(&iclause.RawQuery{Query: expr.String(rawQuery), Args: args}) | ||
}) | ||
} | ||
|
||
func RawQueryExpr[T any](rawQuery litsql.Expression) sq.QueryMod[T] { | ||
return sq.QueryModFunc[T](func(a litsql.QueryBuilder) { | ||
a.AddQueryClause(&iclause.RawQuery{Query: rawQuery}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package iim | ||
|
||
import ( | ||
"github.com/rrgmc/litsql" | ||
"github.com/rrgmc/litsql/expr" | ||
"github.com/rrgmc/litsql/internal/iclause" | ||
"github.com/rrgmc/litsql/sq" | ||
) | ||
|
||
func RawQuery[T any](rawQuery string, args ...any) sq.QueryMod[T] { | ||
return sq.QueryModFunc[T](func(a litsql.QueryBuilder) { | ||
a.AddQueryClause(&iclause.RawQuery{Query: expr.String(rawQuery), Args: args}) | ||
}) | ||
} | ||
|
||
func RawQueryExpr[T any](rawQuery litsql.Expression) sq.QueryMod[T] { | ||
return sq.QueryModFunc[T](func(a litsql.QueryBuilder) { | ||
a.AddQueryClause(&iclause.RawQuery{Query: rawQuery}) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ium | ||
|
||
import ( | ||
"github.com/rrgmc/litsql" | ||
"github.com/rrgmc/litsql/expr" | ||
"github.com/rrgmc/litsql/internal/iclause" | ||
"github.com/rrgmc/litsql/sq" | ||
) | ||
|
||
func RawQuery[T any](rawQuery string, args ...any) sq.QueryMod[T] { | ||
return sq.QueryModFunc[T](func(a litsql.QueryBuilder) { | ||
a.AddQueryClause(&iclause.RawQuery{Query: expr.String(rawQuery), Args: args}) | ||
}) | ||
} | ||
|
||
func RawQueryExpr[T any](rawQuery litsql.Expression) sq.QueryMod[T] { | ||
return sq.QueryModFunc[T](func(a litsql.QueryBuilder) { | ||
a.AddQueryClause(&iclause.RawQuery{Query: rawQuery}) | ||
}) | ||
} |