@@ -791,6 +791,9 @@ func (q *SelectQuery) Rows(ctx context.Context) (*sql.Rows, error) {
791
791
return nil , err
792
792
}
793
793
794
+ // if a comment is propagated via the context, use it
795
+ setCommentFromContext (ctx , q )
796
+
794
797
queryBytes , err := q .AppendQuery (q .db .fmter , q .db .makeQueryBytes ())
795
798
if err != nil {
796
799
return nil , err
@@ -812,6 +815,9 @@ func (q *SelectQuery) Exec(ctx context.Context, dest ...interface{}) (res sql.Re
812
815
return nil , err
813
816
}
814
817
818
+ // if a comment is propagated via the context, use it
819
+ setCommentFromContext (ctx , q )
820
+
815
821
queryBytes , err := q .AppendQuery (q .db .fmter , q .db .makeQueryBytes ())
816
822
if err != nil {
817
823
return nil , err
@@ -872,6 +878,9 @@ func (q *SelectQuery) scanResult(ctx context.Context, dest ...interface{}) (sql.
872
878
return nil , err
873
879
}
874
880
881
+ // if a comment is propagated via the context, use it
882
+ setCommentFromContext (ctx , q )
883
+
875
884
queryBytes , err := q .AppendQuery (q .db .fmter , q .db .makeQueryBytes ())
876
885
if err != nil {
877
886
return nil , err
@@ -924,6 +933,9 @@ func (q *SelectQuery) Count(ctx context.Context) (int, error) {
924
933
return 0 , q .err
925
934
}
926
935
936
+ // if a comment is propagated via the context, use it
937
+ setCommentFromContext (ctx , q )
938
+
927
939
qq := countQuery {q }
928
940
929
941
queryBytes , err := qq .AppendQuery (q .db .fmter , nil )
@@ -1028,6 +1040,9 @@ func (q *SelectQuery) Exists(ctx context.Context) (bool, error) {
1028
1040
}
1029
1041
1030
1042
func (q * SelectQuery ) selectExists (ctx context.Context ) (bool , error ) {
1043
+ // if a comment is propagated via the context, use it
1044
+ setCommentFromContext (ctx , q )
1045
+
1031
1046
qq := selectExistsQuery {q }
1032
1047
1033
1048
queryBytes , err := qq .AppendQuery (q .db .fmter , nil )
@@ -1047,6 +1062,9 @@ func (q *SelectQuery) selectExists(ctx context.Context) (bool, error) {
1047
1062
}
1048
1063
1049
1064
func (q * SelectQuery ) whereExists (ctx context.Context ) (bool , error ) {
1065
+ // if a comment is propagated via the context, use it
1066
+ setCommentFromContext (ctx , q )
1067
+
1050
1068
qq := whereExistsQuery {q }
1051
1069
1052
1070
queryBytes , err := qq .AppendQuery (q .db .fmter , nil )
0 commit comments