How to use the node-firebird-native-api.Status 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 / resultset.ts View on Github external
while (true) {
				let nextFetch: number;

				try {
					nextFetch = await nextFetchPromise;
				}
				catch (e) {
					if (rows.length == 0)
						throw e;
					else {
						this.delayedError = e;
						return { finished: false, rows };
					}
				}

				if (nextFetch == fb.Status.RESULT_OK) {
					const buffer1 = buffer;
					buffer = ++buffer % 2;

					const finish = options && options.fetchSize && rows.length + 1 >= options.fetchSize;

					if (!finish)
						nextFetchPromise = this.resultSetHandle!.fetchNextAsync(status, buffers[buffer]);

					rows.push(await this.statement.dataReader(this.statement.attachment, this.transaction, buffers[buffer1]));

					if (finish)
						return { finished: false, rows };
				}
				else {
					return { finished: true, rows };
				}
github asfernandes / node-firebird-drivers / packages / node-firebird-driver-native / src / lib / blob.ts View on Github external
return await this.attachment.client.statusAction(async status => {
			const readingBytes = Math.min(buffer.length, MAX_SEGMENT_SIZE);
			const segLength = new Uint32Array(1);
			const result = await this.blobHandle!.getSegmentAsync(status, readingBytes, buffer, segLength);

			if (result == fb.Status.RESULT_NO_DATA)
				return -1;

			return segLength[0];
		});
	}