예제 #1
0
        public IOrientDatabaseConnection CreateDatabase(string database, DatabaseType databaseType, StorageType storageType)
        {
            if (string.IsNullOrWhiteSpace(database))
            {
                throw new ArgumentException($"{nameof(database)} cannot be null or zero length.");
            }

            _logger.LogDebug($"Creating database {database}. DatabaseType: {databaseType}. StorageType: {storageType}.");
            return(_connectionStream.Send(new DatabaseCreateOperation(database, databaseType, storageType, _connectionStream.ConnectionMetaData, _options, _serializer, _logger)));
        }
예제 #2
0
 public void Open()
 {
     _connectionStream = new OrientDBBinaryConnectionStream(_options, _logger);
     _logger.LogDebug("Opening connections");
     foreach (var stream in _connectionStream.StreamPool)
     {
         var _openResult = _connectionStream.Send(new ServerOpenOperation(_options, _connectionStream.ConnectionMetaData));
         stream.SessionId = _openResult.SessionId;
         stream.Token     = _openResult.Token;
     }
 }
예제 #3
0
 public void Open()
 {
     _connectionStream = new OrientDBBinaryConnectionStream(_connectionOptions, _logger);
     foreach (var stream in _connectionStream.StreamPool)
     {
         _openResult      = _connectionStream.Send(new DatabaseOpenOperation(_connectionOptions, _connectionStream.ConnectionMetaData));
         stream.SessionId = _openResult.SessionId;
         stream.Token     = _openResult.Token;
         _logger.LogDebug($"Opened connection with session id {stream.SessionId}");
     }
 }
 public IEnumerable <T> Execute <T>(string query) where T : OrientDBEntity
 {
     return(_stream.Send(new DatabaseCommandOperation <T>(_payloadFactory, _stream.ConnectionMetaData, _serializer, _logger, query)).Results);
 }
예제 #5
0
 public void Close()
 {
     _connectionStream.Send(new DatabaseCloseOperation(_openResult.Token, _connectionStream.ConnectionMetaData));
     _connectionStream.Close();
 }