crate / crate/sqlalchemy-cratedb

SQLAlchemy: Improve error message when using `database` path parameter

Open
#81 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
9
Forks
4
Avg merge
6d 12h
Merged PRs (30d)
3

Description

### Problem

When approaching the CrateDB SQLAlchemy dialect with an erroneous connection string including the `database` path parameter, like `crate://localhost/dbname`, it fails using this exception message:
```python
(crate.client.exceptions.ProgrammingError) Connection.__init__() got an unexpected keyword argument 'database'
```

The error message may be improved, specifically because this works well with other databases. However, it can't work with CrateDB, because it does not understand the concept of "databases" at all, but uses "schemas" instead.

### References

- https://github.com/crate/cratedb-examples/pull/174#discussion_r1413249481

Contributor guide

Open the contributing guide

Research direction

No file or test is named. Reproduce the failure with the `crate://localhost/dbname` connection string, then trace SQLAlchemy URL handling in the CrateDB dialect; done means the unsupported `database` parameter produces a clear message explaining that CrateDB uses schemas instead.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql, sqlalchemy
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.