in tbapi/__init__.py [0:0]
def trySelect(self, timestamp: int, streams: 'list[TickStream]', options: SelectionOptions, types: 'list[str]', entities: 'list[str]') -> 'TickCursor':
'''Contextmanager version of select. Usage:
```
with db.newSelect(timestamp, streams, options, types, entities) as cursor:
while cursor.next():
message = cursor.getMessage()
```
'''
cursor = None
try:
cursor = self.__select(timestamp, streams, options, types, entities)
yield cursor
finally:
cursor.close()