Update readme with connection example

This commit is contained in:
Pablo Martin 2023-01-23 14:27:17 +01:00
parent 738c451518
commit 6cefb7ed03

View file

@ -36,6 +36,19 @@ lolaconfig = build_lolaconfig(
) )
``` ```
**Connect to a Trino server**
```python
from lolafect.connections import connect_to_trino, close_trino_connection
connection = connect_to_trino.run(
trino_credentials=my_trino_credentials #You can probably try to fetch this from lolaconfig.TRINO_CREDENTIALS
)
connection.cursor().execute("SELECT 1")
close_trino_connection.run(trino_connection=connection)
```
**Send a warning message to slack if your tasks fails** **Send a warning message to slack if your tasks fails**
```python ```python