check query select
This commit is contained in:
parent
84286cd198
commit
61c8413d3c
|
@ -10,7 +10,7 @@ import (
|
||||||
func (s Service) findByDeviceID(ctx context.Context, id string) (result Device) {
|
func (s Service) findByDeviceID(ctx context.Context, id string) (result Device) {
|
||||||
stm, args, _ := s.Builder.Select("*").From(TableDeviceMngt).Where("device_id = ?", id).ToSql()
|
stm, args, _ := s.Builder.Select("*").From(TableDeviceMngt).Where("device_id = ?", id).ToSql()
|
||||||
|
|
||||||
if err := s.DB.QueryRowContext(ctx, stm, args...).Scan(&result); err != nil {
|
if err := s.DB.GetContext(ctx, &result, stm, args...); err != nil {
|
||||||
logger.Error("devicemngt - findByDeviceID", logger.LogData{
|
logger.Error("devicemngt - findByDeviceID", logger.LogData{
|
||||||
"device_id": id,
|
"device_id": id,
|
||||||
"error": err.Error(),
|
"error": err.Error(),
|
||||||
|
|
Loading…
Reference in New Issue