diff --git a/dist/npm/index.js b/dist/npm/index.js index f966b29..f7e5704 100644 --- a/dist/npm/index.js +++ b/dist/npm/index.js @@ -1519,15 +1519,15 @@ B+=A[v],v(0,Oi.prepareValue)(v));let{fetchE fetchConnectionCache:te,fetchFunction:be}=me,Z=typeof _=="function"?_(f,m):_,fe=te=== !0?{"Neon-Pool-Opt-In":"true"}:{},re={query:B,params:P};i&&i(re);let z;try{z=await(be?? fetch)(Z,{method:"POST",body:JSON.stringify(re),headers:{"Neon-Connection-String":r, -"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",...fe},...ue})}catch(v){let k=new Ze( -`Error connecting to database: ${v.message}`);throw k.sourceError=v,k}if(z.ok){let v=await z. -json(),k=v.fields.map(ie=>ie.name),se=v.fields.map(ie=>$.types.getTypeParser(ie. -dataTypeID)),ne=D===!0?v.rows.map(ie=>ie.map((ce,pe)=>ce===null?null:se[pe](ce))): -v.rows.map(ie=>Object.fromEntries(ie.map((ce,pe)=>[k[pe],ce===null?null:se[pe](ce)]))); -return s&&s(re,v,ne,{arrayMode:D,fullResults:V}),V?(v.viaNeonFetch=!0,v.rowAsArray= -D,v.rows=ne,v):ne}else{let{status:v}=z;if(v===400){let{message:k,code:se}=await z. -json(),ne=new Ze(k);throw ne.code=se,ne}else{let k=await z.text();throw new Ze(`\ -Database error (HTTP status ${v}): ${k}`)}}}}a(ft,"neon");var Ct=qe(_t());at();var Vs=qe(gt()),$=qe(_t());var En=class En extends Ct.Client{constructor(t){super(t);this.config=t}get neonConfig(){ +"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",...fe},cache:"no-store",...ue})}catch(v){ +let k=new Ze(`Error connecting to database: ${v.message}`);throw k.sourceError=v, +k}if(z.ok){let v=await z.json(),k=v.fields.map(ie=>ie.name),se=v.fields.map(ie=>$.types. +getTypeParser(ie.dataTypeID)),ne=D===!0?v.rows.map(ie=>ie.map((ce,pe)=>ce===null? +null:se[pe](ce))):v.rows.map(ie=>Object.fromEntries(ie.map((ce,pe)=>[k[pe],ce=== +null?null:se[pe](ce)])));return s&&s(re,v,ne,{arrayMode:D,fullResults:V}),V?(v.viaNeonFetch= +!0,v.rowAsArray=D,v.rows=ne,v):ne}else{let{status:v}=z;if(v===400){let{message:k, +code:se}=await z.json(),ne=new Ze(k);throw ne.code=se,ne}else{let k=await z.text(); +throw new Ze(`Database error (HTTP status ${v}): ${k}`)}}}}a(ft,"neon");var Ct=qe(_t());at();var Vs=qe(gt()),$=qe(_t());var En=class En extends Ct.Client{constructor(t){super(t);this.config=t}get neonConfig(){ return this.connection.stream}connect(t){let{neonConfig:n}=this;n.forceDisablePgSSL&& (this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&&console.warn("\ SSL is enabled for both Postgres (e.g. ?sslmode=require in the connection string\ diff --git a/dist/serverless.mjs b/dist/serverless.mjs index 62e9384..d3ba5c6 100644 --- a/dist/serverless.mjs +++ b/dist/serverless.mjs @@ -1999,15 +1999,15 @@ g[_],_(0,xs.prepareValue)(_));let{fetchEndp fetchConnectionCache:M,fetchFunction:H}=de,F=typeof E=="function"?E(h,f):E,Y=M=== !0?{"Neon-Pool-Opt-In":"true"}:{},O={query:v,params:S};i&&i(O);let G;try{G=await(H?? fetch)(F,{method:"POST",body:JSON.stringify(O),headers:{"Neon-Connection-String":r, -"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",...Y},...T})}catch(_){let P=new gt( -`Error connecting to database: ${_.message}`);throw P.sourceError=_,P}if(G.ok){let _=await G. -json(),P=_.fields.map(N=>N.name),$=_.fields.map(N=>Le.types.getTypeParser(N.dataTypeID)), -D=A===!0?_.rows.map(N=>N.map((j,q)=>j===null?null:$[q](j))):_.rows.map(N=>Object. -fromEntries(N.map((j,q)=>[P[q],j===null?null:$[q](j)])));return s&&s(O,_,D,{arrayMode:A, -fullResults:b}),b?(_.viaNeonFetch=!0,_.rowAsArray=A,_.rows=D,_):D}else{let{status:_}=G; -if(_===400){let{message:P,code:$}=await G.json(),D=new gt(P);throw D.code=$,D}else{ -let P=await G.text();throw new gt(`Database error (HTTP status ${_}): ${P}`)}}}} -o(St,"neon");var er=nt(Xt());qt();var Pa=nt(Wt()),Le=nt(Xt());var Ae=class extends er.Client{constructor(t){super(t);this.config=t}static{o(this, +"Neon-Raw-Text-Output":"true","Neon-Array-Mode":"true",...Y},cache:"no-store",...T})}catch(_){ +let P=new gt(`Error connecting to database: ${_.message}`);throw P.sourceError=_, +P}if(G.ok){let _=await G.json(),P=_.fields.map(N=>N.name),$=_.fields.map(N=>Le.types. +getTypeParser(N.dataTypeID)),D=A===!0?_.rows.map(N=>N.map((j,q)=>j===null?null:$[q]( +j))):_.rows.map(N=>Object.fromEntries(N.map((j,q)=>[P[q],j===null?null:$[q](j)]))); +return s&&s(O,_,D,{arrayMode:A,fullResults:b}),b?(_.viaNeonFetch=!0,_.rowAsArray= +A,_.rows=D,_):D}else{let{status:_}=G;if(_===400){let{message:P,code:$}=await G.json(), +D=new gt(P);throw D.code=$,D}else{let P=await G.text();throw new gt(`Database er\ +ror (HTTP status ${_}): ${P}`)}}}}o(St,"neon");var er=nt(Xt());qt();var Pa=nt(Wt()),Le=nt(Xt());var Ae=class extends er.Client{constructor(t){super(t);this.config=t}static{o(this, "NeonClient")}get neonConfig(){return this.connection.stream}connect(t){let{neonConfig:n}=this; n.forceDisablePgSSL&&(this.ssl=this.connection.ssl=!1),this.ssl&&n.useSecureWebSocket&& console.warn("SSL is enabled for both Postgres (e.g. ?sslmode=require in the con\ diff --git a/export/httpQuery.ts b/export/httpQuery.ts index fd3e837..2672823 100644 --- a/export/httpQuery.ts +++ b/export/httpQuery.ts @@ -102,6 +102,7 @@ export function neon( 'Neon-Array-Mode': 'true', ...connCacheHeader, }, + cache: 'no-store', ...fetchOptions, });