Skip to main content
Module

x/neo4j_lite_client/mod.ts>Result

Unofficial Neo4j Driver for Deno
Latest
class Result
implements Promise<QueryResult>
Re-export
import { Result } from "https://deno.land/x/neo4j_lite_client@4.4.6/mod.ts";

A stream of Record representing the result of a query. Can be consumed eagerly as Promise resolved with array of records and ResultSummary summary, or rejected with error that contains string code and string message. Alternatively can be consumed lazily using Result#subscribe function.

Constructors

new
Result(
streamObserverPromise: Promise<observer.ResultStreamObserver>,
query: Query,
parameters?: any,
connectionHolder?: connectionHolder.ConnectionHolder,
)

Inject the observer to be used.

Properties

private
_connectionHolder: connectionHolder.ConnectionHolder
private
_p: Promise<QueryResult> | null
private
_parameters: any
private
_query: Query
private
_stack: string | null
private
_streamObserverPromise: Promise<observer.ResultStreamObserver>
readonly
[Symbol.toStringTag]

Methods

private
_createSummary(metadata: any): Promise<ResultSummary>
private
_getOrCreatePromise(): Promise<QueryResult>

Create and return new Promise

_cancel(): void

Signals the stream observer that the future records should be discarded on the server.

catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<QueryResult | TResult>

Catch errors when using promises.

Should not be combined with Result#subscribe function.

finally(onfinally?: (() => void) | null): Promise<QueryResult>

Called when finally the result is done

Should not be combined with Result#subscribe function.

keys(): Promise<string[]>

Returns a promise for the field keys.

Should not be combined with Result#subscribe function.

subscribe(observer: ResultObserver): void

Stream records to observer as they come in, this is a more efficient method of handling the results, and allows you to handle arbitrarily large results.

Returns a promise for the result summary.

Should not be combined with Result#subscribe function.

then<TResult1 = QueryResult, TResult2 = never>(onFulfilled?: ((value: QueryResult) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>

Waits for all results and calls the passed in function with the results.

Should not be combined with Result#subscribe function.