feat: update tools
This commit is contained in:
19
.vscode/settings.json
vendored
19
.vscode/settings.json
vendored
@@ -1,3 +1,20 @@
|
||||
{
|
||||
"editor.fontSize": 10
|
||||
"editor.fontSize": 10,
|
||||
"dbcode.connections": [
|
||||
{
|
||||
"connectionId": "l6fEOogu2kQt5G3BashDt",
|
||||
"name": "10.1.1.2",
|
||||
"driver": "postgres",
|
||||
"connectionType": "host",
|
||||
"host": "10.1.1.2",
|
||||
"port": 5432,
|
||||
"ssl": false,
|
||||
"username": "postgres",
|
||||
"password": "",
|
||||
"savePassword": "secretStorage",
|
||||
"database": "quyun",
|
||||
"readOnly": false,
|
||||
"connectionTimeout": 30
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func (m *{{.PascalTable}}) Create(ctx context.Context) error {
|
||||
{{- end}}
|
||||
|
||||
|
||||
stmt := tblMedias.INSERT(tbl{{.PascalTable}}.MutableColumns).MODEL(m).RETURNING(tblMedias.AllColumns)
|
||||
stmt := tbl{{.PascalTable}}.INSERT(tbl{{.PascalTable}}.MutableColumns).MODEL(m).RETURNING(tbl{{.PascalTable}}.AllColumns)
|
||||
m.log().WithField("func","Create").Info( stmt.DebugSql())
|
||||
|
||||
if err := stmt.QueryContext(ctx, db, m); err != nil {
|
||||
@@ -207,8 +207,7 @@ func (m *{{.PascalTable}}) GetByID(ctx context.Context, id int64, conds ...Cond)
|
||||
func (m *{{.PascalTable}}) Count(ctx context.Context, conds ...Cond) (int64, error) {
|
||||
cond := CondTrue(conds...)
|
||||
|
||||
tbl := tbl{{.PascalTable}}
|
||||
stmt := tbl.SELECT(COUNT(tbl.ID).AS("count")).WHERE(cond)
|
||||
stmt := tbl{{.PascalTable}}.SELECT(COUNT(tbl{{.PascalTable}}.ID).AS("count")).WHERE(cond)
|
||||
m.log().Infof("sql: %s", stmt.DebugSql())
|
||||
|
||||
var count struct {
|
||||
|
||||
Reference in New Issue
Block a user