【发布时间】:2022-01-26 23:43:06
【问题描述】:
在 ENV 中具有 sqlite 数据库的项目上运行 diesel migration run 时,我收到此错误,提示它不是有效的 postgres url。
$ diesel migration run
thread 'main' panicked at '`database.sqlite3` is not a valid database URL. It should start with `postgres://`',
来自项目的 Cargo.toml
[package]
name = "matrix_bot"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
diesel = { version = "1.4.4", features = ["sqlite"] }
dotenv = "0.15.0"
tokio = {version = "1.14.0", features = ["full"]}
matrix-sdk = "0.4.1"
.env 内容
DATABASE_URL=database.sqlite3
【问题讨论】:
-
您没有包含任何代码或
Cargo.toml来显示您的配置,因此无法看到实际问题。
标签: rust rust-diesel