Browse Source

Rename func variable

Volodymyr Tkach 2 years ago
parent
commit
b9d1487fc9
4 changed files with 6 additions and 6 deletions
  1. 1 1
      README.md
  2. 1 1
      gosql/common/common.go
  3. 2 2
      gosql/common/dbmethods.go
  4. 2 2
      gosql/common/tx.go

+ 1 - 1
README.md

@@ -40,7 +40,7 @@ PrepareSQL(query string, args ...any) *common.Prepared
 QueryRowByID(ctx context.Context, id int64, row any) error
 QueryRowByID(ctx context.Context, id int64, row any) error
 RowExists(ctx context.Context, id int64, row any) bool
 RowExists(ctx context.Context, id int64, row any) bool
 UpdateRow(ctx context.Context, row any) error
 UpdateRow(ctx context.Context, row any) error
-UpdateRowOnly(ctx context.Context, row any, only ...string) error
+UpdateRowOnly(ctx context.Context, row any, fields ...string) error
 ```
 ```
 
 
 Please mark structure fields for using this funcs:
 Please mark structure fields for using this funcs:

+ 1 - 1
gosql/common/common.go

@@ -44,7 +44,7 @@ type Engine interface {
 	SetMaxOpenConns(n int)
 	SetMaxOpenConns(n int)
 	Transaction(ctx context.Context, queries func(ctx context.Context, tx *Tx) error) error
 	Transaction(ctx context.Context, queries func(ctx context.Context, tx *Tx) error) error
 	UpdateRow(ctx context.Context, row any) error
 	UpdateRow(ctx context.Context, row any) error
-	UpdateRowOnly(ctx context.Context, row any, only ...string) error
+	UpdateRowOnly(ctx context.Context, row any, fields ...string) error
 }
 }
 
 
 var rSqlParam = regexp.MustCompile(`\$\d+`)
 var rSqlParam = regexp.MustCompile(`\$\d+`)

+ 2 - 2
gosql/common/dbmethods.go

@@ -198,8 +198,8 @@ func (d *DBMethods) UpdateRow(ctx context.Context, row any) error {
 	return err
 	return err
 }
 }
 
 
-func (d *DBMethods) UpdateRowOnly(ctx context.Context, row any, only ...string) error {
-	query, args := updateRowString(row, only...)
+func (d *DBMethods) UpdateRowOnly(ctx context.Context, row any, fields ...string) error {
+	query, args := updateRowString(row, fields...)
 	_, err := d.Exec(ctx, query, args...)
 	_, err := d.Exec(ctx, query, args...)
 	return err
 	return err
 }
 }

+ 2 - 2
gosql/common/tx.go

@@ -144,8 +144,8 @@ func (t *Tx) UpdateRow(ctx context.Context, row any) error {
 	return err
 	return err
 }
 }
 
 
-func (t *Tx) UpdateRowOnly(ctx context.Context, row any, only ...string) error {
-	query, args := updateRowString(row, only...)
+func (t *Tx) UpdateRowOnly(ctx context.Context, row any, fields ...string) error {
+	query, args := updateRowString(row, fields...)
 	_, err := t.Exec(ctx, query, args...)
 	_, err := t.Exec(ctx, query, args...)
 	return err
 	return err
 }
 }