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]) +```