@@ -115,7 +115,7 @@ func (d *DefaultService) ExecWithCtx(
115
115
) {
116
116
// Check if the query is nil
117
117
if query == nil {
118
- return nil , godatabases .ErrNilQuery
118
+ panic ( godatabases .ErrNilQuery )
119
119
}
120
120
121
121
// Run the exec
@@ -134,21 +134,6 @@ func (d *DefaultService) Exec(query *string, params ...interface{}) (
134
134
return d .ExecWithCtx (context .Background (), query , params ... )
135
135
}
136
136
137
- // QueryRowWithCtx runs a query row with parameters and returns the result row with a context
138
- func (d * DefaultService ) QueryRowWithCtx (
139
- ctx context.Context ,
140
- query * string ,
141
- params ... interface {},
142
- ) pgx.Row {
143
- // Check if the query is nil
144
- if query == nil {
145
- return nil
146
- }
147
-
148
- // Run the query row
149
- return d .pool .QueryRow (ctx , * query , params ... )
150
- }
151
-
152
137
// QueryWithCtx runs a query with parameters and returns the result with a context
153
138
func (d * DefaultService ) QueryWithCtx (
154
139
ctx context.Context ,
@@ -157,7 +142,7 @@ func (d *DefaultService) QueryWithCtx(
157
142
) (pgx.Rows , error ) {
158
143
// Check if the query is nil
159
144
if query == nil {
160
- return nil , godatabases .ErrNilQuery
145
+ panic ( godatabases .ErrNilQuery )
161
146
}
162
147
163
148
// Run the query
@@ -172,6 +157,21 @@ func (d *DefaultService) Query(
172
157
return d .QueryWithCtx (context .Background (), query , params ... )
173
158
}
174
159
160
+ // QueryRowWithCtx runs a query row with parameters and returns the result row with a context
161
+ func (d * DefaultService ) QueryRowWithCtx (
162
+ ctx context.Context ,
163
+ query * string ,
164
+ params ... interface {},
165
+ ) pgx.Row {
166
+ // Check if the query is nil
167
+ if query == nil {
168
+ panic (godatabases .ErrNilQuery )
169
+ }
170
+
171
+ // Run the query row
172
+ return d .pool .QueryRow (ctx , * query , params ... )
173
+ }
174
+
175
175
// QueryRow runs a query row with parameters and returns the result row
176
176
func (d * DefaultService ) QueryRow (
177
177
query * string ,
0 commit comments