crate / sqlalchemy-cratedb

SQLAlchemy dialect for CrateDB.
https://cratedb.com/docs/sqlalchemy-cratedb/
Apache License 2.0
3 stars 2 forks source link

Feature Request: Schema support for SQL Alchemy #122

Closed burnes closed 6 years ago

burnes commented 6 years ago

It would be nice to have schema support for SQL Alchemy. Currently all queries without a schema are made against the doc schema. There's no way to provide the schema to the HTTP endpoint via SQL Alchemy dialect (e.g. via Default-Schema header).

https://crate.io/docs/crate/reference/en/latest/protocols/http.html#default-schema

mfussenegger commented 6 years ago

We'll add this to our backlog.

In case you're interested in contributing I think this would be quite easy. You'd have to follow a similar pattern as was used in https://github.com/crate/crate-python/commit/d9392d393bab98695cc772f3456c8cabe8b9deba

Once the base crate client has support for the default schema it should be possible to use it via sqlalchemy:

    >>> sa.create_engine('crate://', connect_args={
    ...     'schema': 'whatever'
    ... })
mfussenegger commented 6 years ago

This has been implemented with https://github.com/crate/crate-python/commit/47ecf93 and was released with 0.22.0