Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite database path #36

Open
nanddalal opened this issue May 28, 2020 · 1 comment
Open

sqlite database path #36

nanddalal opened this issue May 28, 2020 · 1 comment

Comments

@nanddalal
Copy link

Hi!

Thanks for this library -- it has been very useful!!

I was wondering if it is possible to change the path where the sqlite database is stored.

In the current code, the sqlite database is stored in the pylidc installation directory. This means the user must have permissions to write to this directory whenever they import pylidc. However this might not always be the case. For example consider a Dockerfile that looks like this:

USER root
pip install pylidc
USER userA
RUN python -c "import pylidc"

This will fail since userA does not have permissions to write to wherever the root user installed pylidc.

My current workaround is to install pylidc separately for every user. Instead, I was thinking we can change where the sqlite database is stored to a temporary directory like /tmp/pylidc.sqlite?

Thanks again for your help!

Regards,
Nand

@notmatthancock
Copy link
Owner

The sqlalchemy session is set up in pylidc/__init__.py (see _db_path therein). It would be relatively straightforward to make this more flexible by reading the db path from a config file/environment variable or whatever. I don't have time to implement this, but PRs are of course welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants