databend-driver 0.24.5__cp37-abi3-manylinux_2_28_aarch64.whl → 0.24.8__cp37-abi3-manylinux_2_28_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- databend_driver/_databend_driver.abi3.so +0 -0
- {databend_driver-0.24.5.dist-info → databend_driver-0.24.8.dist-info}/METADATA +56 -12
- databend_driver-0.24.8.dist-info/RECORD +6 -0
- {databend_driver-0.24.5.dist-info → databend_driver-0.24.8.dist-info}/WHEEL +1 -1
- databend_driver-0.24.5.dist-info/RECORD +0 -6
|
Binary file
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: databend-driver
|
|
3
|
-
Version: 0.24.
|
|
3
|
+
Version: 0.24.8
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
-
Requires-Dist: pdoc ; extra == 'docs'
|
|
8
|
-
Requires-Dist: behave ; extra == 'test'
|
|
9
|
-
Requires-Dist: ruff ; extra == 'lint'
|
|
10
|
-
Provides-Extra: docs
|
|
11
|
-
Provides-Extra: test
|
|
12
|
-
Provides-Extra: lint
|
|
13
7
|
Summary: Databend Driver Python Binding
|
|
14
8
|
Author: Databend Authors <opensource@databend.com>
|
|
15
9
|
Author-email: Databend Authors <opensource@databend.com>
|
|
@@ -29,12 +23,40 @@ maturin develop
|
|
|
29
23
|
|
|
30
24
|
## Usage
|
|
31
25
|
|
|
26
|
+
### PEP 249 cursor object
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from databend_driver import BlockingDatabendClient
|
|
30
|
+
|
|
31
|
+
client = BlockingDatabendClient('databend://root:root@localhost:8000/?sslmode=disable')
|
|
32
|
+
cursor = client.cursor()
|
|
33
|
+
|
|
34
|
+
cursor.execute(
|
|
35
|
+
"""
|
|
36
|
+
CREATE TABLE test (
|
|
37
|
+
i64 Int64,
|
|
38
|
+
u64 UInt64,
|
|
39
|
+
f64 Float64,
|
|
40
|
+
s String,
|
|
41
|
+
s2 String,
|
|
42
|
+
d Date,
|
|
43
|
+
t DateTime
|
|
44
|
+
)
|
|
45
|
+
"""
|
|
46
|
+
)
|
|
47
|
+
cursor.execute("INSERT INTO test VALUES", (1, 1, 1.0, 'hello', 'world', '2021-01-01', '2021-01-01 00:00:00'))
|
|
48
|
+
cursor.execute("SELECT * FROM test")
|
|
49
|
+
rows = cursor.fetchall()
|
|
50
|
+
for row in rows:
|
|
51
|
+
print(row.values())
|
|
52
|
+
```
|
|
53
|
+
|
|
32
54
|
### Blocking
|
|
33
55
|
|
|
34
56
|
```python
|
|
35
57
|
from databend_driver import BlockingDatabendClient
|
|
36
58
|
|
|
37
|
-
client = BlockingDatabendClient('databend
|
|
59
|
+
client = BlockingDatabendClient('databend://root:root@localhost:8000/?sslmode=disable')
|
|
38
60
|
conn = client.get_conn()
|
|
39
61
|
conn.exec(
|
|
40
62
|
"""
|
|
@@ -61,7 +83,7 @@ import asyncio
|
|
|
61
83
|
from databend_driver import AsyncDatabendClient
|
|
62
84
|
|
|
63
85
|
async def main():
|
|
64
|
-
client = AsyncDatabendClient('databend
|
|
86
|
+
client = AsyncDatabendClient('databend://root:root@localhost:8000/?sslmode=disable')
|
|
65
87
|
conn = await client.get_conn()
|
|
66
88
|
await conn.exec(
|
|
67
89
|
"""
|
|
@@ -152,6 +174,7 @@ class AsyncDatabendConnection:
|
|
|
152
174
|
async def query_row(self, sql: str) -> Row: ...
|
|
153
175
|
async def query_iter(self, sql: str) -> RowIterator: ...
|
|
154
176
|
async def stream_load(self, sql: str, data: list[list[str]]) -> ServerStats: ...
|
|
177
|
+
async def load_file(self, sql: str, file: str, format_option: dict, copy_options: dict = None) -> ServerStats: ...
|
|
155
178
|
```
|
|
156
179
|
|
|
157
180
|
### BlockingDatabendClient
|
|
@@ -160,6 +183,7 @@ class AsyncDatabendConnection:
|
|
|
160
183
|
class BlockingDatabendClient:
|
|
161
184
|
def __init__(self, dsn: str): ...
|
|
162
185
|
def get_conn(self) -> BlockingDatabendConnection: ...
|
|
186
|
+
def cursor(self) -> BlockingDatabendCursor: ...
|
|
163
187
|
```
|
|
164
188
|
|
|
165
189
|
### BlockingDatabendConnection
|
|
@@ -172,6 +196,18 @@ class BlockingDatabendConnection:
|
|
|
172
196
|
def query_row(self, sql: str) -> Row: ...
|
|
173
197
|
def query_iter(self, sql: str) -> RowIterator: ...
|
|
174
198
|
def stream_load(self, sql: str, data: list[list[str]]) -> ServerStats: ...
|
|
199
|
+
def load_file(self, sql: str, file: str, format_option: dict, copy_options: dict = None) -> ServerStats: ...
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### BlockingDatabendCursor
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
class BlockingDatabendCursor:
|
|
206
|
+
def close(self) -> None: ...
|
|
207
|
+
def execute(self, operation: str, params: list[string] | tuple[string] = None) -> None | int: ...
|
|
208
|
+
def executemany(self, operation: str, params: list[list[string] | tuple[string]]) -> None | int: ...
|
|
209
|
+
def fetchone(self) -> Row: ...
|
|
210
|
+
def fetchall(self) -> list[Row]: ...
|
|
175
211
|
```
|
|
176
212
|
|
|
177
213
|
### Row
|
|
@@ -179,6 +215,10 @@ class BlockingDatabendConnection:
|
|
|
179
215
|
```python
|
|
180
216
|
class Row:
|
|
181
217
|
def values(self) -> tuple: ...
|
|
218
|
+
def __len__(self) -> int: ...
|
|
219
|
+
def __iter__(self) -> list: ...
|
|
220
|
+
def __dict__(self) -> dict: ...
|
|
221
|
+
def __getitem__(self, key: int | str) -> any: ...
|
|
182
222
|
```
|
|
183
223
|
|
|
184
224
|
### RowIterator
|
|
@@ -258,8 +298,12 @@ make up
|
|
|
258
298
|
|
|
259
299
|
```shell
|
|
260
300
|
cd bindings/python
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
301
|
+
uv sync
|
|
302
|
+
source .venv/bin/activate
|
|
303
|
+
maturin develop --uv
|
|
304
|
+
|
|
305
|
+
behave tests/asyncio
|
|
306
|
+
behave tests/blocking
|
|
307
|
+
behave tests/cursor
|
|
264
308
|
```
|
|
265
309
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
databend_driver-0.24.8.dist-info/METADATA,sha256=W6Dn_rgeZ6gQiUgVlDgIYMydVC284ZrTexXBTp8dp28,7065
|
|
2
|
+
databend_driver-0.24.8.dist-info/WHEEL,sha256=rZtu3Yho_XsPjnJWH5t8b8HP2LkLyT3py7wnmR5UdP4,107
|
|
3
|
+
databend_driver/__init__.py,sha256=sNam6xQNlyVYUm7qBdX4cDxsxlgHgr3zYavOp8uielw,626
|
|
4
|
+
databend_driver/__init__.pyi,sha256=O4kAHPNAc6FIHI2yeb8sxlxpdbGfkoeYjSzH8YMpJgU,2602
|
|
5
|
+
databend_driver/_databend_driver.abi3.so,sha256=s6LlUPNSDt108K02YZ0bea2VXkpQAFl2ziZBdNRgezM,18280208
|
|
6
|
+
databend_driver-0.24.8.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
databend_driver-0.24.5.dist-info/METADATA,sha256=LoNrRy_TYR21VHBZc6L2Q4RRvTgLHeyO_jAPc-pRJhM,5752
|
|
2
|
-
databend_driver-0.24.5.dist-info/WHEEL,sha256=4n3qyBiNTnxMQaYall96Q8NYlqL_SJO8QX7MdLWdOFo,107
|
|
3
|
-
databend_driver/__init__.py,sha256=sNam6xQNlyVYUm7qBdX4cDxsxlgHgr3zYavOp8uielw,626
|
|
4
|
-
databend_driver/__init__.pyi,sha256=O4kAHPNAc6FIHI2yeb8sxlxpdbGfkoeYjSzH8YMpJgU,2602
|
|
5
|
-
databend_driver/_databend_driver.abi3.so,sha256=SjRavmO3NNmlBfx2714XlsI0a5hgCaveV24x_FHJTAI,17911616
|
|
6
|
-
databend_driver-0.24.5.dist-info/RECORD,,
|