From a376de9aed76e7e217e423c817ec12abe23c4f31 Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Sun, 4 Jun 2023 21:18:46 +0200 Subject: [PATCH] Update README.md Signed-off-by: Lorenzo Mangani --- examples/python/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/python/README.md b/examples/python/README.md index 04f84be..46734e8 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -7,3 +7,14 @@ Example gRPC Flight SQL API client using Python3 python3 client.py ``` +#### Example +```python +from flightsql import connect, FlightSQLClient + +client = FlightSQLClient(host='localhost',port=8082,insecure=True,metadata={'bucket':'company_sensors'}) +conn = connect(client) +cursor = conn.cursor() +cursor.execute('SELECT * FROM cpu LIMIT 1;') +# print("columns:", cursor.description) +print("rows:", [r for r in cursor]) +```