public short Run() { CommandPayload payload = new CommandPayload(); payload.Type = CommandPayloadType.Sql; payload.Text = ToString(); payload.NonTextLimit = -1; payload.FetchPlan = ""; payload.SerializedParams = new byte[] { 0 }; Command operation = new Command(); operation.OperationMode = OperationMode.Synchronous; operation.ClassType = CommandClassType.NonIdempotent; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); var clusterId = short.Parse(result.ToDocument().GetField <string>("Content")); _connection.Database.AddCluster(_className, clusterId); if (_autoProperties) { CreateAutoProperties(); } return(clusterId); }
public string Run() { OCluster cluster; var defaultClusterId = _connection.Database.GetClusterIdFor(_className); if (defaultClusterId == -1) { CommandPayloadCommand payload = new CommandPayloadCommand(); payload.Text = ToString(); Command operation = new Command(_connection.Database); operation.OperationMode = OperationMode.Synchronous; operation.CommandPayload = payload; var doc = _connection.ExecuteOperation(operation); OCommandResult result = new OCommandResult(doc); // var clusterId = short.Parse(result.ToDocument().GetField<string>("Content")); cluster = _connection.Database.AddCluster(new OCluster { Name = _className }); } else { cluster = _connection.Database.GetClusters().FirstOrDefault(c => c.Name == _className); } if (_autoProperties) { CreateAutoProperties(); } return(cluster.Name); }
public short Run() { if (string.IsNullOrEmpty(_class)) { throw new OException(OExceptionType.Query, "Class is empty"); } CommandPayload payload = new CommandPayload(); payload.Type = CommandPayloadType.Sql; payload.Text = ToString(); payload.NonTextLimit = -1; payload.FetchPlan = ""; payload.SerializedParams = new byte[] { 0 }; Command operation = new Command(); operation.OperationMode = OperationMode.Synchronous; operation.ClassType = CommandClassType.NonIdempotent; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); return(short.Parse(result.ToDocument().GetField <string>("Content"))); }
public ODocument Run() { CommandPayloadCommand payload = new CommandPayloadCommand(); payload.Text = ToString(); Command operation = new Command(_connection.Database); operation.OperationMode = OperationMode.Synchronous; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); return(result.ToSingle()); }
public int Run() { CommandPayloadCommand payload = new CommandPayloadCommand(); payload.Text = ToString(); Command operation = new Command(_connection.Database); operation.OperationMode = OperationMode.Synchronous; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); return(int.Parse(result.ToDocument().GetField <string>("Content"))); }
public short Run() { if (string.IsNullOrEmpty(_class)) throw new OException(OExceptionType.Query, "Class is empty"); CommandPayloadCommand payload = new CommandPayloadCommand(); payload.Text = ToString(); Command operation = new Command(_connection.Database); operation.OperationMode = OperationMode.Synchronous; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); return short.Parse(result.ToDocument().GetField<string>("Content")); }
public List <ODocument> ToList(string fetchPlan) { CommandPayloadQuery payload = new CommandPayloadQuery(); payload.Text = ToString(); payload.NonTextLimit = -1; payload.FetchPlan = fetchPlan; //payload.SerializedParams = new byte[] { 0 }; Command operation = new Command(_connection.Database); operation.OperationMode = OperationMode.Asynchronous; operation.CommandPayload = payload; OCommandResult commandResult = new OCommandResult(_connection.ExecuteOperation(operation)); return(commandResult.ToList()); }
public int Run() { CommandPayload payload = new CommandPayload(); payload.Type = CommandPayloadType.Sql; payload.Text = ToString(); payload.NonTextLimit = -1; payload.FetchPlan = ""; payload.SerializedParams = new byte[] { 0 }; Command operation = new Command(); operation.OperationMode = OperationMode.Synchronous; operation.ClassType = CommandClassType.NonIdempotent; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation <Command>(operation)); return(int.Parse(result.ToDocument().GetField <string>("Content"))); }
public OVertex Run() { CommandPayload payload = new CommandPayload(); payload.Type = CommandPayloadType.Sql; payload.Text = ToString(); payload.NonTextLimit = -1; payload.FetchPlan = ""; payload.SerializedParams = new byte[] { 0 }; Command operation = new Command(); operation.OperationMode = OperationMode.Synchronous; operation.ClassType = CommandClassType.NonIdempotent; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); return(result.ToSingle().To <OVertex>()); }
public List <ODocument> ToList(string fetchPlan) { CommandPayload payload = new CommandPayload(); payload.Type = CommandPayloadType.Sql; payload.Text = ToString(); payload.NonTextLimit = -1; payload.FetchPlan = fetchPlan; payload.SerializedParams = new byte[] { 0 }; Command operation = new Command(); operation.OperationMode = OperationMode.Asynchronous; operation.ClassType = CommandClassType.Idempotent; operation.CommandPayload = payload; OCommandResult commandResult = new OCommandResult(_connection.ExecuteOperation <Command>(operation)); return(commandResult.ToList()); }
public short Run() { if (string.IsNullOrEmpty(_class)) { throw new OException(OExceptionType.Query, "Class is empty"); } CommandPayloadCommand payload = new CommandPayloadCommand(); payload.Text = ToString(); Command operation = new Command(_connection.Database); operation.OperationMode = OperationMode.Synchronous; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); return(short.Parse(result.ToDocument().GetField <string>("Content"))); }
public short Run() { if (string.IsNullOrEmpty(_class)) throw new OException(OExceptionType.Query, "Class is empty"); CommandPayload payload = new CommandPayload(); payload.Type = CommandPayloadType.Sql; payload.Text = ToString(); payload.NonTextLimit = -1; payload.FetchPlan = ""; payload.SerializedParams = new byte[] { 0 }; Command operation = new Command(); operation.OperationMode = OperationMode.Synchronous; operation.ClassType = CommandClassType.NonIdempotent; operation.CommandPayload = payload; OCommandResult result = new OCommandResult(_connection.ExecuteOperation(operation)); return short.Parse(result.ToDocument().GetField<string>("Content")); }