File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
packages/instrumentation-pg Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,8 @@ export class PgInstrumentation extends InstrumentationBase<PgInstrumentationConf
341341 : firstArgIsQueryObjectWithText
342342 ? {
343343 ...( arg0 as any ) ,
344+ name : arg0 . name ,
345+ text : arg0 . text ,
344346 values :
345347 ( arg0 as any ) . values ??
346348 ( Array . isArray ( args [ 1 ] ) ? args [ 1 ] : undefined ) ,
Original file line number Diff line number Diff line change @@ -583,10 +583,15 @@ describe('pg', () => {
583583 } ) ;
584584
585585 it ( 'should record query and values for prepared statements' , done => {
586- const queryConfig = {
587- name : 'get_pg_tables' ,
588- text : 'SELECT * FROM pg_tables WHERE schemaname = $1' ,
589- } ;
586+ class Statement {
587+ get name ( ) {
588+ return 'get_pg_tables' ;
589+ }
590+ get text ( ) {
591+ return 'SELECT * FROM pg_tables WHERE schemaname = $1' ;
592+ }
593+ }
594+ const queryConfig = new Statement ( ) ;
590595 const values = [ 'public' ] ;
591596
592597 const expectedAttributes = {
You can’t perform that action at this time.
0 commit comments