biolab / biolab/orange2

problem accessing sqlite databases with full path

Open
#47 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
304
Forks
142
PR merge metrics
No merged PRs in 30d

Description

Hi all,
I'm trying to use the SQLReader class in python script widget to access a sqlite database placed in a different path than orange itself. Here's the code:

```
from Orange.data.sql import *
r = SQLReader()
r.connect('sqlite:///d:/path/to/database.db/')
```

and this is the log:

```
Running script:
Traceback (most recent call last):
File "", line 1, in
File "", line 4, in
File "[...]\Orange\utils\__init__.py", line 214, in wrap_call
return func(*args, **kwargs)
File "[...]\Orange\data\sql.py", line 195, in connect
(self.quirks, self.conn) = _connection(uri)
File "[...]\Orange\data\sql.py", line 141, in _connection
return (quirks, dbmod.connect(host))
ValueError: database parameter must be string or APSW Connection object
```

Looking at the source code it seem that the connection string is not treated at it should since
[line 15](https://github.com/biolab/orange/blob/master/Orange/data/sql.py#L15) is handling the third slash incorrectly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.