Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return await attachment.client.statusAction(async status => {
//// FIXME: options/flags, dialect
statement.statementHandle = await attachment!.attachmentHandle!.prepareAsync(status, transaction.transactionHandle,
0, sqlStmt, 3, fb.Statement.PREPARE_PREFETCH_ALL);
statement.inMetadata = fixMetadata(status, await statement.statementHandle!.getInputMetadataAsync(status));
statement.outMetadata = fixMetadata(status, await statement.statementHandle!.getOutputMetadataAsync(status));
if (statement.inMetadata) {
statement.inBuffer = new Uint8Array(statement.inMetadata.getMessageLengthSync(status));
statement.dataWriter = createDataWriter(createDescriptors(status, statement.inMetadata));
}
if (statement.outMetadata) {
statement.outBuffer = new Uint8Array(statement.outMetadata.getMessageLengthSync(status));
statement.dataReader = createDataReader(createDescriptors(status, statement.outMetadata));
}
return statement;
});