File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,9 @@ function Postgres(a, b) {
176176 return { state : result . state , unlisten }
177177 }
178178
179- channels [ name ] = { result : sql `listen ${ sql ( name ) } ` , listeners : [ listener ] }
179+ channels [ name ] = { result : sql `listen ${
180+ sql . unsafe ( '"' + name . replace ( / " / g, '""' ) + '"' )
181+ } `, listeners : [ listener ] }
180182 const result = await channels [ name ] . result
181183 listener . onlisten && listener . onlisten ( )
182184 return { state : result . state , unlisten }
Original file line number Diff line number Diff line change @@ -700,7 +700,7 @@ t('multiple listeners work after a reconnect', async() => {
700700
701701t ( 'listen and notify with weird name' , async ( ) => {
702702 const sql = postgres ( options )
703- const channel = 'wat-;ø §'
703+ const channel = 'wat-;.ø. §'
704704 const result = await new Promise ( async r => {
705705 await sql . listen ( channel , r )
706706 sql . notify ( channel , 'works' )
You can’t perform that action at this time.
0 commit comments