Skip to content

Commit 54f0c9f

Browse files
committed
rename vals
1 parent 8ed9c26 commit 54f0c9f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

orm/query_delete.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import (
44
"database/sql"
55
)
66

7-
func (m Query[T]) Delete(primaryValues ...interface{}) QueryResult {
7+
func (m Query[T]) Delete(primaryIds ...interface{}) QueryResult {
88
if len(m.tables) == 0 {
99
m.setErr(ErrTableNotSelected)
1010
return m.result
1111
}
12-
if len(primaryValues) > 0 {
13-
return m.Where(m.tables[0].tableStruct.Field(0).Addr().Interface(), WhereIn, primaryValues).delete()
12+
if len(primaryIds) > 0 {
13+
return m.Where(m.tables[0].tableStruct.Field(0).Addr().Interface(), WhereIn, primaryIds).delete()
1414
} else {
1515
return m.delete()
1616
}

orm/query_get.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ func (m Query[T]) Get(primaryValue ...interface{}) (T, QueryResult) {
1919
}
2020

2121
//get slice T
22-
func (m Query[T]) Gets(primaryValues ...interface{}) ([]T, QueryResult) {
22+
func (m Query[T]) Gets(primaryIds ...interface{}) ([]T, QueryResult) {
2323
var ret []T
24-
if len(primaryValues) > 0 {
25-
res := m.Where(m.tables[0].tableStruct.Field(0).Addr().Interface(), WhereIn, primaryValues).GetTo(&ret)
24+
if len(primaryIds) > 0 {
25+
res := m.Where(m.tables[0].tableStruct.Field(0).Addr().Interface(), WhereIn, primaryIds).GetTo(&ret)
2626
return ret, res
2727
} else {
2828
res := m.GetTo(&ret)

0 commit comments

Comments
 (0)