You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/timeplus-connect.md
+17-2Lines changed: 17 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
# timeplus-connect (Python)
2
2
3
-
`timeplus-connect` is the recommended Python library to connect to Timeplus Proton and Timeplus Enterprise. It's a high performance database driver for connecting Timeplus to Python, Pandas, and Superset
3
+
`timeplus-connect` is the recommended Python library to connect to Timeplus Proton and Timeplus Enterprise. It's a high performance database driver for connecting Timeplus to Python, Pandas, and Superset
4
4
* Pandas DataFrames
5
5
* Numpy Arrays
6
6
* PyArrow Tables
7
7
* Superset Connector
8
8
* SQLAlchemy 1.3 and 1.4 (limited feature set)
9
9
10
-
Timeplus Connect currently uses the Timeplus HTTP interface for maximum compatibility, defaulting to 8123.
10
+
Timeplus Connect currently uses the Timeplus HTTP interface for maximum compatibility, defaulting to 8123 (batch query). You can also use 3218 port for [streaming queries](#streaming-query).
11
11
12
12
The source code and latest releases are available on [GitHub](https://github.com/timeplus-io/timeplus-connect).
13
13
@@ -18,6 +18,21 @@ pip install timeplus-connect
18
18
```
19
19
Timeplus Connect requires Python 3.9 or higher.
20
20
21
+
## Streaming Query
22
+
The SQLAlchemy or DBAPI don't support streaming queries. You can use the low level HTTP client interface to perform streaming queries.
23
+
24
+
```python
25
+
client=timeplus_connect.get_client(
26
+
host="timeplus_host",
27
+
port=3218, # make sure to use 3218 port for streaming query
28
+
username="timeplus", # for Timeplus Proton, username=default, and password is an empty string
29
+
password=os.environ.get("PWD"),
30
+
)
31
+
with client.query_arrow_stream('select ..') as _stream:
32
+
for _batch in _stream:
33
+
_batch.to_pandas()
34
+
```
35
+
21
36
## SQLAlchemy Implementation
22
37
Timeplus Connect incorporates a minimal SQLAlchemy implementation (without any ORM features) for compatibility with Superset. It has only been tested against SQLAlchemy versions 1.3.x and 1.4.x, and is unlikely to work with more complex SQLAlchemy applications.
0 commit comments