chdb-io / chdb

chDB is an in-process OLAP SQL Engine 🚀 powered by ClickHouse
https://clickhouse.com/docs/en/chdb
Apache License 2.0
2.03k stars 72 forks source link

Make DBAPI implementation use session, fix execute for none-returning queries #169

Closed yunyu closed 9 months ago

yunyu commented 9 months ago

Fixes #163 #162

Changelog category (leave one):

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Make dbapi implementation use session, which is stateful (most consumers of dbapi likely want statefulness). Also fix execute to not throw an exception for None-returning queries like CREATE TABLE.

Documentation entry for user-facing changes

CLAassistant commented 9 months ago

CLA assistant check
All committers have signed the CLA.

yunyu commented 9 months ago

Hmm, I signed the CLA but the comment isn't updating:

image

Also not sure why the bot is saying "Yunyu Lin seems not to be a GitHub user"

lmangani commented 9 months ago

@yunyu this usually means the commits within the PR were pushed to your branch with a different user (or no user)

yunyu commented 9 months ago

Got it, CLA fixed!

yunyu commented 9 months ago

Btw @lmangani do you know why the test fails with ENGINE = Memory (which should persist data, given it's the same session?) but not with ENGINE = Log?

lmangani commented 9 months ago

Btw @lmangani do you know why the test fails with ENGINE = Memory (which should persist data, given it's the same session?) but not with ENGINE = Log?

Sessions are files. My guess the Memory engine bypasses the session persistence entirely. @auxten can confirm best.

auxten commented 9 months ago

@lmangani is right. chDB session relies on persistence of database storage files. But, supporting session on ENGINE = Memory is reasonable. I will find a way to support that.