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

数据库更换为Sqlite3的简单方法 #47

Open
johngai19 opened this issue Dec 28, 2019 · 0 comments
Open

数据库更换为Sqlite3的简单方法 #47

johngai19 opened this issue Dec 28, 2019 · 0 comments

Comments

@johngai19
Copy link

在完成例子的时候没有安装PostgreSql,就想更换为sqlite3. npm i --save sqlite3,修改配置如下。
在运行时提示不能在项目外导入模块。查资料说是因为程序在运行时从src编译到了dist,因此把entity从src修改到了dist之后可以正常使用。

还想更换为mongodb但是显示没有成功,可能因为跟案例里面的自增id有关,有机会可以再测试一下。

{
    "type": "sqlite",
    "database": "./mydb.sql",
    "entities": [
        "dist/**/**.entity{.ts,.js}"
    ],
    "synchronize": true,
    "logging": true
}
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

1 participant