Code quality check
This commit is contained in:
parent
da7f7e12f3
commit
02f8098811
13
wire.ts
13
wire.ts
@ -1103,7 +1103,7 @@ function wire_impl(
|
|||||||
): ResultStream<Row> {
|
): ResultStream<Row> {
|
||||||
log("debug", { query: query }, `executing simple query`);
|
log("debug", { query: query }, `executing simple query`);
|
||||||
|
|
||||||
const { chunks, err } = await pipeline(
|
yield* await pipeline(
|
||||||
() => (write(QueryMessage, { query }), write_copy_in(stdin)),
|
() => (write(QueryMessage, { query }), write_copy_in(stdin)),
|
||||||
async () => {
|
async () => {
|
||||||
for (let chunks = [], err; ; ) {
|
for (let chunks = [], err; ; ) {
|
||||||
@ -1111,7 +1111,8 @@ function wire_impl(
|
|||||||
switch (msg_type(msg)) {
|
switch (msg_type(msg)) {
|
||||||
default:
|
default:
|
||||||
case ReadyForQuery.type:
|
case ReadyForQuery.type:
|
||||||
return { chunks, err };
|
if (err) throw err;
|
||||||
|
else return chunks;
|
||||||
|
|
||||||
case RowDescription.type: {
|
case RowDescription.type: {
|
||||||
const Row = make_row_ctor(ser_decode(RowDescription, msg));
|
const Row = make_row_ctor(ser_decode(RowDescription, msg));
|
||||||
@ -1135,8 +1136,6 @@ function wire_impl(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
yield* chunks;
|
|
||||||
if (err) throw err;
|
|
||||||
return { tag: "" };
|
return { tag: "" };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1168,7 +1167,7 @@ function wire_impl(
|
|||||||
});
|
});
|
||||||
write(Execute, { portal, row_limit: 0 });
|
write(Execute, { portal, row_limit: 0 });
|
||||||
await write_copy_in(stdin);
|
await write_copy_in(stdin);
|
||||||
write(Close, { which: "P" as const, name: portal });
|
write(Close, { which: "P", name: portal });
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
await read(BindComplete);
|
await read(BindComplete);
|
||||||
@ -1181,7 +1180,7 @@ function wire_impl(
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
try {
|
try {
|
||||||
await pipeline(
|
await pipeline(
|
||||||
() => write(Close, { which: "P" as const, name: portal }),
|
() => write(Close, { which: "P", name: portal }),
|
||||||
() => read(CloseComplete)
|
() => read(CloseComplete)
|
||||||
);
|
);
|
||||||
} catch {
|
} catch {
|
||||||
@ -1242,7 +1241,7 @@ function wire_impl(
|
|||||||
return { tag };
|
return { tag };
|
||||||
} finally {
|
} finally {
|
||||||
await pipeline(
|
await pipeline(
|
||||||
() => write(Close, { which: "P" as const, name: portal }),
|
() => write(Close, { which: "P", name: portal }),
|
||||||
() => read(CloseComplete)
|
() => read(CloseComplete)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user