Ejemplo n.º 1
0
 public async Task <FluentResults.Result> Alter(Api.Operation op, CallOptions?options = null)
 {
     return(await DgraphExecute(
                async (dg) => {
         await dg.AlterAsync(op, options ?? new CallOptions());
         return Results.Ok();
     },
                (rpcEx) => Results.Fail(new FluentResults.ExceptionalError(rpcEx))
                ));
 }
Ejemplo n.º 2
0
        public void AlterSchema(string newSchema)
        {
            AssertNotDisposed();

            var op = new Api.Operation();

            op.Schema = newSchema;

            connections.Values.ElementAt(rnd.Next(connections.Count)).Alter(op);
        }
Ejemplo n.º 3
0
        public async Task <FluentResults.Result> AlterSchema(string newSchema)
        {
            AssertNotDisposed();

            var op = new Api.Operation();

            op.Schema = newSchema;

            try {
                await connections[GetNextConnection()].Alter(op);
                return(Results.Ok());
            } catch (RpcException rpcEx) {
                return(Results.Fail(new FluentResults.ExceptionalError(rpcEx)));
            }
        }
Ejemplo n.º 4
0
        public async Task <FluentResults.Result> DropAll()
        {
            AssertNotDisposed();

            var op = new Api.Operation()
            {
                DropAll = true
            };

            try {
                await connections[GetNextConnection()].Alter(op);
                return(Results.Ok());
            } catch (RpcException rpcEx) {
                return(Results.Fail(new FluentResults.ExceptionalError(rpcEx)));
            }
        }
Ejemplo n.º 5
0
        // FIXME: should allow cancellation tokens, deadlines, etc??

        #region mutations

        public async Task Alter(Api.Operation op)
        {
            AssertNotDisposed();

            await connection.AlterAsync(op);
        }
Ejemplo n.º 6
0
        // FIXME: add checkversion

        // FIXME: should allow cancellation tokens, deadlines, etc??

        #region mutations

        public void Alter(Api.Operation op)
        {
            AssertNotDisposed();

            connection.Alter(op);
        }