diff --git a/packages/client/src/InfluxDBClient.ts b/packages/client/src/InfluxDBClient.ts index 64f8384f..9fa2a0bb 100644 --- a/packages/client/src/InfluxDBClient.ts +++ b/packages/client/src/InfluxDBClient.ts @@ -98,22 +98,18 @@ export default class InfluxDBClient { * @param queryType - The type of query (default: 'sql'). * @returns An async generator that yields PointValues object. */ - async *queryPoints( + queryPoints( query: string, database?: string, queryType: QueryType = 'sql' ): AsyncGenerator { - const points = this._queryApi.queryPoints( + return this._queryApi.queryPoints( query, database ?? this._options.database ?? throwReturn(new Error(argumentErrorMessage)), queryType ) - - for await (const point of points) { - yield point - } } /** diff --git a/packages/client/test/unit/util/point.test.ts b/packages/client/test/unit/util/point.test.ts index d91310bd..a4f56fc3 100644 --- a/packages/client/test/unit/util/point.test.ts +++ b/packages/client/test/unit/util/point.test.ts @@ -4,6 +4,7 @@ import {Point, PointValues, convertTime} from '../../../src' describe('point', () => { it('creates point with various fields', () => { const point = Point.measurement('blah') + .setMeasurement('') .setBooleanField('truthy', true) .setBooleanField('falsy', false) .setIntegerField('intFromString', '20')