Skip to content

Instantly share code, notes, and snippets.

@agrothe
Created May 17, 2020 17:00
Show Gist options
  • Save agrothe/f4e196ff52b7eb4138b31bc82c7b3223 to your computer and use it in GitHub Desktop.
Save agrothe/f4e196ff52b7eb4138b31bc82c7b3223 to your computer and use it in GitHub Desktop.
Interface for coronabytes/ArangoDB ArangoContext.
using Core.Arango.Protocol;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace Core.Arango
{
public interface IArangoContext
{
public Action<string, IDictionary<string, object>, JToken> QueryProfile { get; set; }
public string Realm { get; }
public int BatchSize { get; set; }
public string Server { get; }
public static string AddQueryString(string uri, IEnumerable<KeyValuePair<string, string>> queryString) => throw new NotImplementedException();
public static string Parameterize(FormattableString query, out Dictionary<string, object> parameter) => throw new NotImplementedException();
public Task AbortTransactionAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task<ArangoHandle> BeginTransactionAsync(ArangoHandle database, ArangoTransaction request, CancellationToken cancellationToken = default);
public Task CommitTransactionAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task CreateAnalyzerAsync(ArangoHandle database, ArangoAnalyzer analyzer, CancellationToken cancellationToken = default);
public Task CreateCollectionAsync(ArangoHandle database, string collection, ArangoCollectionType type, CancellationToken cancellationToken = default);
public Task CreateCollectionAsync(ArangoHandle database, ArangoCollection collection, CancellationToken cancellationToken = default);
public Task<bool> CreateDatabaseAsync(ArangoHandle name, CancellationToken cancellationToken = default);
public Task<T> CreateDocumentAsync<T>(ArangoHandle database, string collection, T doc, bool waitForSync = false, bool silent = true, bool overwrite = false, CancellationToken cancellationToken = default) where T : class;
public Task CreateDocumentsAsync<T>(ArangoHandle database, string collection, IEnumerable<T> docs, bool waitForSync = false, bool silent = true, bool overwrite = false, bool bulk = false, CancellationToken cancellationToken = default) where T : class;
public Task CreateGraphAsync(ArangoHandle database, ArangoGraph request, CancellationToken cancellationToken = default);
public Task CreateViewAsync(ArangoHandle database, ArangoView view, CancellationToken cancellationToken = default);
public string DbName(string name);
public Task DeleteAnalyzerAsync(ArangoHandle database, string analyzer, bool force = false, CancellationToken cancellationToken = default);
public Task<ArangoUpdateResult<TR>> DeleteDocumentAsync<TR>(ArangoHandle database, string collection, string key, bool? waitForSync = null, bool? returnOld = null, bool? silent = null, CancellationToken cancellationToken = default);
public Task<List<ArangoUpdateResult<TR>>> DeleteDocumentsAsync<T, TR>(ArangoHandle database, string collection, IEnumerable<T> docs, bool? waitForSync = null, bool? returnOld = null, CancellationToken cancellationToken = default) where T : class;
public Task DropCollectionAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default);
public Task DropDatabaseAsync(ArangoHandle name, CancellationToken cancellationToken = default);
public Task DropGraphAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default);
public Task DropIndexAsync(ArangoHandle database, string index, CancellationToken cancellationToken = default);
public Task DropIndicesAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task DropViewAsync(ArangoHandle database, string name, CancellationToken cancellationToken = default);
public Task DropViewsAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task EnsureIndexAsync(ArangoHandle database, string collection, ArangoIndex request, CancellationToken cancellationToken = default);
public Task<JObject> ExecuteTransactionAsync(ArangoHandle database, ArangoTransaction request, CancellationToken cancellationToken = default);
public Task<bool> ExistDatabaseAsync(ArangoHandle name, CancellationToken cancellationToken = default);
public IAsyncEnumerable<List<JObject>> ExportAsync(ArangoHandle database, string collection, bool? flush = null, int? flushWait = null, int? batchSize = null, int? ttl = null, [EnumeratorCancellation] CancellationToken cancellationToken = default);
public Task<List<T>> FindAsync<T>(ArangoHandle database, string collection, FormattableString filter, string projection = null, int limit = 1000, CancellationToken cancellationToken = default) where T : new();
public Task<Version> GetVersionAsync(CancellationToken cancellationToken = default);
public Task<List<ArangoAnalyzer>> ListAnalyzersAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task<List<string>> ListCollectionsAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task<List<string>> ListDatabasesAsync(CancellationToken cancellationToken = default);
public Task<List<string>> ListGraphAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task<List<string>> ListIndicesAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default);
public Task<List<string>> ListViewsAsync(ArangoHandle database, CancellationToken cancellationToken = default);
public Task<ArangoList<T>> QueryAsync<T>(ArangoHandle database, string query, IDictionary<string, object> bindVars, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default) where T : new();
public Task<ArangoList<T>> QueryAsync<T>(ArangoHandle database, FormattableString query, bool? cache = null, CancellationToken cancellationToken = default) where T : new();
public Task<object> QueryAsync(Type type, bool isEnumerable, ArangoHandle database, string query, IDictionary<string, object> bindVars, bool? cache = null, bool? fullCount = null, CancellationToken cancellationToken = default);
public Task<ArangoUpdateResult<TR>> ReplaceDocumentAsync<T, TR>(ArangoHandle database, string collection, T doc, bool waitForSync = false, bool? returnOld = null, bool? returnNew = null, CancellationToken cancellationToken = default) where T : class;
public Task<ArangoUpdateResult<JObject>> ReplaceDocumentAsync<T>(ArangoHandle database, string collection, T doc, bool waitForSync = false, bool? returnOld = null, bool? returnNew = null, CancellationToken cancellationToken = default) where T : class;
public Task<List<ArangoUpdateResult<JObject>>> ReplaceDocumentsAsync<T>(ArangoHandle database, string collection, IEnumerable<T> docs, bool? waitForSync = null, bool? returnOld = null, bool? returnNew = null, CancellationToken cancellationToken = default) where T : class;
public Task<List<ArangoUpdateResult<TR>>> ReplaceDocumentsAsync<T, TR>(ArangoHandle database, string collection, IEnumerable<T> docs, bool? waitForSync = null, bool? returnOld = null, bool? returnNew = null, CancellationToken cancellationToken = default) where T : class;
public Task<T> SendAsync<T>(HttpMethod m, string url, string body = null, string transaction = null, bool throwOnError = true, bool auth = true, CancellationToken cancellationToken = default);
public Task<object> SendAsync(Type type, HttpMethod m, string url, string body = null, string transaction = null, bool throwOnError = true, bool auth = true, CancellationToken cancellationToken = default);
public Task<T> SingleOrDefaultAsync<T>(ArangoHandle database, string collection, FormattableString filter, string projection = null, CancellationToken cancellationToken = default) where T : new();
public Task TruncateCollectionAsync(ArangoHandle database, string collection, CancellationToken cancellationToken = default);
public Task<ArangoUpdateResult<JObject>> UpdateDocumentAsync<T>(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, CancellationToken cancellationToken = default) where T : class;
public Task<ArangoUpdateResult<TR>> UpdateDocumentAsync<T, TR>(ArangoHandle database, string collection, T doc, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, CancellationToken cancellationToken = default) where T : class;
public Task<List<ArangoUpdateResult<JObject>>> UpdateDocumentsAsync<T>(ArangoHandle database, string collection, IEnumerable<T> docs, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, CancellationToken cancellationToken = default) where T : class;
public Task<List<ArangoUpdateResult<TR>>> UpdateDocumentsAsync<T, TR>(ArangoHandle database, string collection, IEnumerable<T> docs, bool? waitForSync = null, bool? keepNull = null, bool? mergeObjects = null, bool? returnOld = null, bool? returnNew = null, bool? silent = null, CancellationToken cancellationToken = default) where T : class;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment