Skip to content

Commit 2d37f92

Browse files
authored
Merge pull request #4 from everpcpc/fix-driver
feat: switch driver backend
2 parents d28546d + 45e99f8 commit 2d37f92

15 files changed

+303
-143
lines changed

.github/workflows/test.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ jobs:
1111
runs-on: ubuntu-latest
1212
services:
1313
databend:
14-
# image: datafuselabs/databend-query
1514
image: datafuselabs/databend
1615
env:
1716
QUERY_DEFAULT_USER: databend
@@ -22,26 +21,32 @@ jobs:
2221
- 9000:9000
2322
steps:
2423
- name: Checkout
25-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2625

27-
- name: Setup Python-3.10
26+
- name: Setup Python
2827
uses: actions/setup-python@v4
2928
with:
30-
python-version: '3.10'
29+
python-version: '3.11'
3130

3231
- name: Pip Install
3332
run: |
34-
make install
33+
pip install pipenv
34+
pipenv install --dev --skip-lock
3535
3636
- name: Verify Service Running
3737
run: |
3838
cid=$(docker ps -a | grep databend | cut -d' ' -f1)
3939
docker logs ${cid}
4040
curl -v http://localhost:8000/v1/health
4141
42-
- name: Test
42+
- name: Unit Test
4343
env:
44-
TEST_DATABEND_DSN: "http://databend:databend@localhost:8000/default?secure=false"
44+
TEST_DATABEND_DSN: "databend://databend:databend@localhost:8000/default?sslmode=disable"
4545
run: |
46-
make unittest
47-
make integration
46+
pipenv run pytest -s tests/unit
47+
48+
- name: Integration Test
49+
env:
50+
TEST_DATABEND_DSN: "databend://databend:databend@localhost:8000/default?sslmode=disable"
51+
run: |
52+
pipenv run pytest -s tests/integration

Pipfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
databend-sqlalchemy = {file = ".", editable = true}
8+
9+
[dev-packages]
10+
black = "*"
11+
flake8 = "*"
12+
pytest = "*"
13+
14+
[requires]
15+
python_version = "3.11"

Pipfile.lock

+191
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ The DSN format is similar to that of regular Postgres::
1818
from sqlalchemy import create_engine, text
1919
from sqlalchemy.engine.base import Connection, Engine
2020
engine = create_engine(
21-
f"databend://{username}:{password}@{host_port_name}/{database_name}?secure=false"
21+
f"databend://{username}:{password}@{host_port_name}/{database_name}?sslmode=disable"
2222
)
2323
connection = engine.connect()
2424
result = connection.execute(text("SELECT 1"))
2525
assert len(result.fetchall()) == 1
2626

2727
import connector
28-
cursor = connector.connect('http://root:@localhost:8081').cursor()
28+
cursor = connector.connect('databend://root:@localhost:8000?sslmode=disable').cursor()
2929
cursor.execute('SELECT * FROM test')
3030
# print(cursor.fetchone())
3131
# print(cursor.fetchall())

databend_sqlalchemy/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env python
22

33

4-
from databend_sqlalchemy.entry_points import validate_entrypoints # noqa
5-
64
VERSION = (0, 3, 2)
75
__version__ = ".".join(str(x) for x in VERSION)

0 commit comments

Comments
 (0)