Skip to content

Commit b5a801d

Browse files
committed
Added more details full example of doing and printing a query
1 parent f9bffe4 commit b5a801d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,14 @@ It will execute sql query and keep listening streaming data.
9191
9292
client.query('select * from table1')
9393
94-
This command returns a generator. It can be printed e.g. by reading its values via `next(query)` or a for loop:
94+
This command returns a generator. It can be printed e.g. by reading its values via `next(query)` or a for loop. Here is a complete example:
9595

9696
.. code:: python
9797
98-
for item in query:
99-
print(item)
100-
98+
from ksql import KSQLAPI
99+
client = KSQLAPI('http://localhost:8088')
100+
query = client.query('select * from table1')
101+
for item in query: print(item)
101102
102103
- Example Response
103104

0 commit comments

Comments
 (0)