1using System.Runtime.CompilerServices;
38 CancellationToken cancel =
default)
62 CancellationToken cancel =
default);
88 CancellationToken cancel =
default);
113 CancellationToken cancel =
default);
140 CancellationToken cancel =
default)
169 CancellationToken cancel =
default)
196 CancellationToken cancel =
default);
223 CancellationToken cancel =
default);
252 CancellationToken cancel =
default);
282 CancellationToken cancel =
default);
310 CancellationToken cancel =
default);
339 CancellationToken cancel =
default);
362 CancellationToken cancel =
default)
377 internal abstract Task<QuerySuccess<T>> QueryAsyncInternal<T>(
382 CancellationToken cancel
391 CancellationToken cancel =
default)
393 QueryAsync<T>(query, Serializer.Generate<T>(MappingCtx), queryOptions, cancel);
399 CancellationToken cancel =
default) =>
400 QueryAsync<object?>(query, Serializer.Dynamic, queryOptions, cancel);
407 CancellationToken cancel =
default) =>
408 QueryAsyncInternal(query, serializer, MappingCtx, queryOptions, cancel);
415 CancellationToken cancel =
default) =>
422 CancellationToken cancel =
default)
424 PaginateAsync(query, Serializer.Generate<T>(MappingCtx), queryOptions, cancel);
430 CancellationToken cancel =
default)
432 PaginateAsync(page, Serializer.Generate<T>(MappingCtx), queryOptions, cancel);
438 CancellationToken cancel =
default) =>
439 PaginateAsync(query, Serializer.Dynamic, queryOptions, cancel);
445 CancellationToken cancel =
default) =>
446 PaginateAsync(page, Serializer.Dynamic, queryOptions, cancel);
453 CancellationToken cancel =
default)
455 var serializer =
new PageSerializer<T>(elemSerializer);
456 return PaginateAsyncInternal(query, serializer, queryOptions, cancel);
464 CancellationToken cancel =
default)
466 var serializer =
new PageSerializer<T>(elemSerializer);
467 return PaginateAsyncInternal(page, serializer, queryOptions, cancel);
475 CancellationToken cancel =
default)
478 var serializer =
new PageSerializer<object?>(elemObjSer);
479 return PaginateAsyncInternal(query, serializer, queryOptions, cancel);
487 CancellationToken cancel =
default)
490 var serializer =
new PageSerializer<object?>(elemObjSer);
491 return PaginateAsyncInternal(page, serializer, queryOptions, cancel);
497 CancellationToken cancel =
default) where T : notnull
499 if (reference.IsLoaded)
501 return reference.Get();
504 var q = FQL($
"{reference}");
506 return res.Data.Get();
512 internal async IAsyncEnumerable<Page<T>> PaginateAsyncInternal<T>(
514 PageSerializer<T> serializer,
516 [EnumeratorCancellation] CancellationToken cancel =
default)
518 var p = await QueryAsyncInternal(query,
524 await
foreach (var page
in PaginateAsyncInternal(p.Data, serializer, queryOptions, cancel))
530 private async IAsyncEnumerable<Page<T>> PaginateAsyncInternal<T>(
532 PageSerializer<T> serializer,
534 [EnumeratorCancellation] CancellationToken cancel =
default)
538 while (page.After is not
null)
542 var response = await QueryAsyncInternal(q,
548 page = response.Data;
564 internal abstract IAsyncEnumerator<Event<T>> SubscribeStreamInternal<T>(
567 CancellationToken cancel =
default) where T : notnull;
582 CancellationToken cancellationToken =
default) where T : notnull
584 EventSource eventSource = streamOptions?.Token !=
null
585 ?
new EventSource(streamOptions.Token) { Options = streamOptions }
586 : await GetEventSourceFromQueryAsync(query, queryOptions, cancellationToken);
600 CancellationToken cancellationToken =
default) where T : notnull
602 await Task.CompletedTask;
617 internal abstract IAsyncEnumerator<FeedPage<T>> SubscribeFeedInternal<T>(
620 CancellationToken cancel =
default) where T : notnull;
633 CancellationToken cancellationToken =
default) where T : notnull
635 await Task.CompletedTask;
637 if (feedOptions !=
null) eventSource.Options = feedOptions;
653 CancellationToken cancellationToken =
default) where T : notnull
655 EventSource eventSource = await GetEventSourceFromQueryAsync(query,
null, cancellationToken);
656 if (feedOptions !=
null) eventSource.Options = feedOptions;
668 private async Task<EventSource> GetEventSourceFromQueryAsync(
671 CancellationToken cancellationToken)
675 var response = await QueryAsync<EventSource>(
679 return response.Data;
683 throw new InvalidOperationException(
"Query must return an EventSource.", ex);
698 CancellationToken cancel =
default) where T : notnull
700 return SubscribeStreamInternal<T>(eventSource, ctx, cancel);
714 CancellationToken cancel =
default) where T : notnull
716 return SubscribeFeedInternal<T>(eventSource, ctx, cancel);
The base class for Client and DataContext.
IAsyncEnumerable< Page< T > > PaginateAsync< T >(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
IAsyncEnumerator< Event< T > > SubscribeStream< T >(EventSource eventSource, MappingContext ctx, CancellationToken cancel=default)
Opens the stream with Fauna and returns an enumerator for the stream events.
async Task< FeedEnumerable< T > > EventFeedAsync< T >(EventSource eventSource, FeedOptions? feedOptions=null, CancellationToken cancellationToken=default)
Opens the event feed with Fauna and returns an enumerator for the events.
IAsyncEnumerable< Page< object?> > PaginateAsync(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
IAsyncEnumerable< Page< object?> > PaginateAsync(Query query, ISerializer elemSerializer, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
async Task< StreamEnumerable< T > > EventStreamAsync< T >(Query query, QueryOptions? queryOptions=null, StreamOptions? streamOptions=null, CancellationToken cancellationToken=default)
Retrieves a Stream token from Fauna and returns a StreamEnumerable for the stream events.
async Task< T > LoadRefAsync< T >(BaseRef< T > reference, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database and returns the typed result...
Task< QuerySuccess< object?> > QueryAsync(Query query, ISerializer serializer, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database and returns the typed result...
IAsyncEnumerable< Page< object?> > PaginateAsync(Page< object?> page, ISerializer elemSerializer, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
Task< QuerySuccess< object?> > QueryAsync(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database.A Task representing the asyn...
Task< QuerySuccess< T > > QueryAsync< T >(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database and returns the typed result...
IAsyncEnumerable< Page< object?> > PaginateAsync(Page< object?> page, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
IAsyncEnumerator< FeedPage< T > > SubscribeFeed< T >(EventSource eventSource, MappingContext ctx, CancellationToken cancel=default)
Opens an event feed with Fauna and returns an enumerator for the events.
Represents a Fauna Event Feed.
Represents the options when subscribing to Fauna Event Feeds.
Represents the options for customizing Fauna queries.
A class representing a Fauna Event Stream. Additional queries will be made during enumeration.
Represents error that occur during serialization and deserialization of Fauna data.
A class representing the mapping context to be used during serialization and deserialization.
Represents an FQL query expression. This class encapsulates a list of IQueryFragment instances,...
Represents the abstract base class for constructing FQL queries.
Represents a literal part of an FQL query. This class is used for embedding raw string values directl...
Represents the options when subscribing to Fauna Event Streams.
An abstract class representing a reference that can wrap an instance of the referenced document.
Represents a Fauna EventSource for initializing Streams and Feeds.
Represents a client for interacting with a Fauna.
IAsyncEnumerable< Page< T > > PaginateAsync< T >(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
IAsyncEnumerable< Page< object?> > PaginateAsync(Page< object?> page, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
IAsyncEnumerable< Page< object?> > PaginateAsync(Page< object?> page, ISerializer elemSerializer, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
Task< QuerySuccess< object?> > QueryAsync(Query query, ISerializer serializer, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database and returns the typed result...
Task< QuerySuccess< T > > QueryAsync< T >(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database and returns the typed result...
IAsyncEnumerable< Page< object?> > PaginateAsync(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
Task< T > LoadRefAsync< T >(BaseRef< T > reference, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database and returns the typed result...
IAsyncEnumerable< Page< object?> > PaginateAsync(Query query, ISerializer elemSerializer, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously iterates over pages of a Fauna query result, automatically fetching subsequent pages u...
Task< QuerySuccess< object?> > QueryAsync(Query query, QueryOptions? queryOptions=null, CancellationToken cancel=default)
Asynchronously executes a specified FQL query against the Fauna database.
A generic interface that defines serialize and deserialize behavior for a specific type,...
record Page< T >(IReadOnlyList< T > Data, string? After)
Represents a page in a dataset for pagination.