C# native client for FaunaDB. More...
Classes | |
struct | ErrorsWrapper |
Public Member Functions | |
FaunaClient (string secret, string endpoint="https://db.fauna.com:443", TimeSpan? timeout=null, HttpClient httpClient=null, Version httpVersion=null, bool checkNewVersion=true, IReadOnlyDictionary< string, string > customHeaders=null) | |
Constructs a new instance of FaunaClient with the specified arguments. More... | |
FaunaClient (IClientIO clientIO) | |
Constructs a new instance of FaunaClient with the specified IClientIO. More... | |
FaunaClient | NewSessionClient (string secret) |
Creates a new FaunaClient with the user secret provided. Queries submitted to a session client will be authenticated with the secret provided. A session client shares its parent's internal resources. More... | |
async Task< Value > | Query (Expr expression, TimeSpan? queryTimeout=null) |
Issues a Query to FaunaDB. More... | |
async Task< Value[]> | Query (params Expr[] expressions) |
Issues multiple queries to FaunaDB. More... | |
async Task< Value[]> | Query (TimeSpan queryTimeout, params Expr[] expressions) |
Issues multiple queries to FaunaDB. More... | |
async Task< IEnumerable< Value > > | Query (IEnumerable< Expr > expressions, TimeSpan? queryTimeout=null) |
Issues multiple queries to FaunaDB. More... | |
async Task< string > | Ping (string scope=null, int? timeout=null) |
Check service health. More... | |
async Task< StreamingEventHandler > | Stream (Expr data=null, IReadOnlyList< EventField > fields=null) |
Static Public Member Functions | |
static ObjectV | FromJson (string json) |
C# native client for FaunaDB.
Queries are constructed by using static helpers in Language package.
Definition at line 25 of file FaunaClient.cs.
FaunaDB.Client.FaunaClient.FaunaClient | ( | string | secret, |
string | endpoint = "https://db.fauna.com:443" , |
||
TimeSpan? | timeout = null , |
||
HttpClient | httpClient = null , |
||
Version | httpVersion = null , |
||
bool | checkNewVersion = true , |
||
IReadOnlyDictionary< string, string > | customHeaders = null |
||
) |
Constructs a new instance of FaunaClient with the specified arguments.
secret | Auth token for the FaunaDB server. |
endpoint | URL for the FaunaDB server. Defaults to "https://db.fauna.com:443" |
timeout | Timeout for I/O operations. Defaults to 1 minute. |
httpVersion | Version of http. Default value is HttpVersion.Version11, is you use .net core 3.0 and above you can enable http/2 support by passing HttpVersion.Version20 |
checkNewVersion | Check new NuGet package driver version. Default value is true (Check new version). |
Definition at line 37 of file FaunaClient.cs.
FaunaDB.Client.FaunaClient.FaunaClient | ( | IClientIO | clientIO | ) |
Constructs a new instance of FaunaClient with the specified IClientIO.
Definition at line 51 of file FaunaClient.cs.
|
static |
Definition at line 238 of file FaunaClient.cs.
FaunaClient FaunaDB.Client.FaunaClient.NewSessionClient | ( | string | secret | ) |
Creates a new FaunaClient with the user secret provided. Queries submitted to a session client will be authenticated with the secret provided. A session client shares its parent's internal resources.
secret | Auth token for the FaunaDB server. |
async Task<string> FaunaDB.Client.FaunaClient.Ping | ( | string | scope = null , |
int? | timeout = null |
||
) |
Check service health.
scope | Must be "node", "local", "global", or "all". Defaults to "global" |
timeout | Time to wait for the ping to succeed, in milliseconds. |
async Task<Value> FaunaDB.Client.FaunaClient.Query | ( | Expr | expression, |
TimeSpan? | queryTimeout = null |
||
) |
Queries are modeled through the FaunaDB query language, represented by the helper functions in the Language class.
Responses are modeled as a general response tree. Each node is a Value, and can be coerced to structured types through various methods on that class.
expression | Expression generated by methods of Language. |
queryTimeout | Timeout for that specific query (it will override the client timetout, if any). |
async Task<IEnumerable<Value> > FaunaDB.Client.FaunaClient.Query | ( | IEnumerable< Expr > | expressions, |
TimeSpan? | queryTimeout = null |
||
) |
Issues multiple queries to FaunaDB.
These queries are sent to FaunaDB in a single request, and are evaluated. The list of response nodes is returned in the same order as the issued queries.
See Query(Expr) for more information on the individual queries.
expressions | the list of query expressions to be sent to FaunaDB. |
queryTimeout | Timeout for that specific query (it will override the client timetout, if any). |
Definition at line 130 of file FaunaClient.cs.
Issues multiple queries to FaunaDB.
These queries are sent to FaunaDB in a single request, and are evaluated. The list of response nodes is returned in the same order as the issued queries.
See Query(Expr) for more information on the individual queries.
expressions | the list of query expressions to be sent to FaunaDB. |
Definition at line 92 of file FaunaClient.cs.
async Task<Value[]> FaunaDB.Client.FaunaClient.Query | ( | TimeSpan | queryTimeout, |
params Expr[] | expressions | ||
) |
Issues multiple queries to FaunaDB.
These queries are sent to FaunaDB in a single request, and are evaluated. The list of response nodes is returned in the same order as the issued queries.
See Query(Expr) for more information on the individual queries.
queryTimeout | Timeout for that specific query (it will override the client timetout, if any). |
expressions | the list of query expressions to be sent to FaunaDB. |
Definition at line 111 of file FaunaClient.cs.
async Task<StreamingEventHandler> FaunaDB.Client.FaunaClient.Stream | ( | Expr | data = null , |
IReadOnlyList< EventField > | fields = null |
||
) |
Definition at line 156 of file FaunaClient.cs.