@@ -1789,14 +1789,14 @@ t('Recreate prepared statements on RevalidateCachedQuery error', async() => {
17891789 ]
17901790} )
17911791
1792- t ( 'Properly throws routing error on not prepared statements' , async ( ) => {
1792+ t ( 'Properly throws routine error on not prepared statements' , async ( ) => {
17931793 await sql `create table x (x text[])`
17941794 const { routine } = await sql . unsafe ( `insert into x(x) values (('a', 'b'))` ) . catch ( e => e )
17951795
17961796 return [ 'transformAssignedExpr' , routine , await sql `drop table x` ]
17971797} )
17981798
1799- t ( 'Properly throws routing error on not prepared statements in transaction' , async ( ) => {
1799+ t ( 'Properly throws routine error on not prepared statements in transaction' , async ( ) => {
18001800 const { routine } = await sql . begin ( sql => [
18011801 sql `create table x (x text[])` ,
18021802 sql `insert into x(x) values (('a', 'b'))` ,
@@ -1805,6 +1805,15 @@ t('Properly throws routing error on not prepared statements in transaction', asy
18051805 return [ 'transformAssignedExpr' , routine ]
18061806} )
18071807
1808+ t ( 'Properly throws routine error on not prepared statements using file' , async ( ) => {
1809+ const { routine } = await sql . unsafe ( `
1810+ create table x (x text[]);
1811+ insert into x(x) values (('a', 'b'));
1812+ ` , { prepare : true } ) . catch ( e => e )
1813+
1814+ return [ 'transformAssignedExpr' , routine ]
1815+ } )
1816+
18081817t ( 'Catches connection config errors' , async ( ) => {
18091818 const sql = postgres ( { ...options , user : { toString : ( ) => { throw new Error ( 'wat' ) } } , database : 'prut' } )
18101819
0 commit comments