Using a sqlite database fails

未關閉
#141 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
python, sqlite
領域
backend, databases

研究方向

從 mautrix/util/async_db/aiosqlite.py 的第 107-108 行附近開始,重現 issue 中的 sqlite:///db/filename.db 和 sqlite:////db/filename.db 情況。確認該行為是否符合預期,然後明確說明行為或前面的設定文件,並驗證絕對路徑範例是否如預期運作。

由索引模型根據 Issue 內容生成。

描述

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).

主要語言
Python
星號
249
分支
84
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

mautrix/python 的其他 Issue

查看 mautrix/python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。