How to use the node-firebird-native-api.Statement function in node-firebird-native-api

To help you get started, we’ve selected a few node-firebird-native-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github asfernandes / node-firebird-drivers / packages / node-firebird-driver-native / src / lib / statement.ts View on Github external
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;
		});