Skip to content

Commit da80bab

Browse files
committed
Add another example
1 parent 27a705c commit da80bab

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from questdb.ingress import Sender, Buffer, TimestampNanos
2+
3+
if __name__ == '__main__':
4+
with Sender('localhost', 9009) as sender:
5+
buffer = sender.new_buffer()
6+
buffer.row(
7+
'line_sender_buffer_example',
8+
symbols={'id': 'Hola'},
9+
columns={'price': '111222233333i', 'qty': 3.5},
10+
at=TimestampNanos(111222233333)
11+
)
12+
buffer.row(
13+
'line_sender_example',
14+
symbols={'id': 'Adios'},
15+
columns={'price': '111222233343i', 'qty': 2.5},
16+
at=TimestampNanos(111222233343)
17+
)
18+
# last line is not flushed
19+
sender.flush(buffer)

examples/line_sender_example.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
from questdb.ingress import Sender
22

3+
4+
# buffer.tabular(
5+
# # 'table_name',
6+
# # [['abc', 123, 3.14, 'xyz'],
7+
# # ['def', 456, 6.28, 'abc'],
8+
# # ['ghi', 789, 9.87, 'def']],
9+
# # header=['col1', 'col2', 'col3', 'col4'],
10+
# # symbols=True) # `col1` and `col4` are SYMBOL columns.
11+
def tabular(sender, table_name):
12+
pass
13+
14+
315
if __name__ == '__main__':
416
with Sender('localhost', 9009) as sender:
517
sender.row(

0 commit comments

Comments
 (0)