@@ -9,14 +9,14 @@ func CustomRowQuery(db *gorm.DB) {
99 debugLog (" CustomRowQuery called" )
1010 debugLog (" db.Error: %v" , db .Error )
1111 debugLog (" db.DryRun: %t" , db .DryRun )
12-
12+
1313 if db .Error == nil {
1414 debugLog (" No error, calling BuildQuerySQL" )
1515 // This is what GORM's BuildQuerySQL does for Raw queries
1616 if db .Statement .SQL .Len () == 0 {
1717 debugLog (" SQL is empty, this shouldn't happen for Raw() queries" )
1818 }
19-
19+
2020 // Check for DryRun or Error before proceeding
2121 if db .DryRun || db .Error != nil {
2222 debugLog (" DryRun=%t or Error=%v, returning early" , db .DryRun , db .Error )
@@ -33,10 +33,10 @@ func CustomRowQuery(db *gorm.DB) {
3333 debugLog (" SQL: %s" , db .Statement .SQL .String ())
3434 debugLog (" Vars: %v" , db .Statement .Vars )
3535 debugLog (" ConnPool type: %T" , db .Statement .ConnPool )
36-
36+
3737 result := db .Statement .ConnPool .QueryRowContext (db .Statement .Context , db .Statement .SQL .String (), db .Statement .Vars ... )
3838 debugLog (" QueryRowContext returned: %v (nil: %t)" , result , result == nil )
39-
39+
4040 db .Statement .Dest = result
4141 debugLog (" After assignment - Statement.Dest: %v (nil: %t)" , db .Statement .Dest , db .Statement .Dest == nil )
4242 }
@@ -46,4 +46,4 @@ func CustomRowQuery(db *gorm.DB) {
4646 } else {
4747 debugLog (" db.Error is not nil: %v" , db .Error )
4848 }
49- }
49+ }
0 commit comments