Giter Club home page Giter Club logo

Comments (5)

auxten avatar auxten commented on June 12, 2024

chDB do have Python DB-API support. See https://github.com/chdb-io/chdb/blob/main/examples/dbapi.py
I didn't try it with SQLAlchemy. You can give it a try. If any problem, please tell me here or on discord.

from chdb.

flyly0755 avatar flyly0755 commented on June 12, 2024

seems not support, coz uri is a fundamental parameter. with uri(user:password@dbip:port/dbname), client side can connect with database server.
But with chdb, all things is in memory, not related with network. So can't communicate with client side with uri except extra dialect supported by sqlalchemy.
for example, sqlite support memory mode, similar to chdb.
We can integrate sqlite with sqlalchemy with uri

from sqlalchemy import create_engine

# format 1, disk mode, uri = sqlite:///home/stephen/db1.db
engine = create_engine('sqlite:///home/stephen/db1.db')
# format 2,  memory mode, uri = sqlite:///:memory:
engine = create_engine('sqlite:///:memory:')

session = sessionmaker(bind=engine)()

if chdb wants to support sqlalchemy, first need to negotiate one recognized uri, for example chdb:///:memory:

from chdb.

flyly0755 avatar flyly0755 commented on June 12, 2024

@auxten I also ask sqlalchemy for this question ^_^
Need extra database dialect code development to support this function.
sqlalchemy/sqlalchemy#11319
chdb and sqlalchemy both sides need to negotiate this work.

from chdb.

auxten avatar auxten commented on June 12, 2024

Thank you! I will look into this tomorrow. BTW, are you interested to contribute this for chDB?😉

from chdb.

flyly0755 avatar flyly0755 commented on June 12, 2024

Yes, I am interested😊, but I am not familar with lower level logics of sqlalchemy dialect.
Maybe in the future after I understand these base knowledge, I can make a help.
By the way, I have found the link of supported sqlalchemy dialect
https://docs.sqlalchemy.org/en/14/dialects/

from chdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.