Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with CHDB? #279

Open
yunyu opened this issue Dec 20, 2023 · 1 comment
Open

Usage with CHDB? #279

yunyu opened this issue Dec 20, 2023 · 1 comment

Comments

@yunyu
Copy link

yunyu commented Dec 20, 2023

Describe the bug
Is there an easy way to use clickhouse-sqlalchemy with https://github.com/chdb-io/chdb/, for use cases like integration tests? It looks like the only available drivers are native http or asynch.

To Reproduce
Try to connect with chdb using the DB-API driver, i.e. clickhouse+chdb://. The driver isn't supported

Expected behavior
Sqlalchemy connects with CHDB

Versions

  • 0.3.0
  • 3.11
@auxten
Copy link

auxten commented Apr 26, 2024

Hello guys, can we add chdb support to this project?
chdb is an in-process version of the ClickHouse engine.
Currently, chdb has already supported DB-API, and here's how to use it.
I'm not a SQLAlchemy expert, so I hope to get your help:

from chdb import dbapi

conn = dbapi.connect(path="some_local_path")
cur = conn.cursor()
cur.execute("CREATE DATABASE e ENGINE = Atomic;")
cur.execute("CREATE TABLE e.hi (a String primary key, b Int32) Engine = MergeTree ORDER BY a;")
cur.execute("INSERT INTO e.hi (a, b) VALUES (%s, %s);", ["he", 32])

cur.close()
conn.close()

Also: chdb-io/chdb#213

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants