Using a sqlite database fails

Open
#141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python, sqlite
Domain
backend, databases

Research direction

Start with mautrix/util/async_db/aiosqlite.py around lines 107-108 and reproduce the sqlite:///db/filename.db and sqlite:////db/filename.db cases from the issue. Determine whether the handling is expected, then make the behavior or the preceding configuration documentation clear and verify the absolute-path example works as intended.

Written by the indexing model from the issue text.

Description

I am trying to use the url "sqlite:///db/filename.db"(three forward slashes) to mean the file "/db/filename.db" in the config.yaml of a python bridge (googlechat). This doesn't work, and after a bit of debugging I realized that it should be written with four forward slashes (sqlite:////db/filename.db)

These two lines seem to handle this bit:

https://github.com/mautrix/python/blob/0b674872c228f70b41d6443f665515caee828463/mautrix/util/async_db/aiosqlite.py#L107-L108

I am wondering if this is a bug or expected and if the latter, maybe the documentation on the preceding lines should be updated/clarified.

This is on docker, btw. Since on docker the working directory is not writable, I would guess the most common use case would be to write an absolute path to a volume (i e /db/something.db).

Dominant language
Python
Stars
249
Forks
84
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mautrix/python

All issues in mautrix/python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.