0

所以我正在尝试使用 mikro-orm 和 postgresql 在visualstudio代码中创建db,但出现错误:

createdb lireddit
The name "createdb" is not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling
name, as well as the presence and correctness of the path, and then try again.
+ createdb <<<<  lireddit
    + CategoryInfo          : ObjectNotFound: (createdb:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

在此之前,我用 yarn 安装了 mikro-orm 和 postgresql,但它似乎不起作用。

4

1 回答 1

0

mikro-orm 文档中没有提到使用 createdb mikro-orm docs创建数据库的选项。

您所关注的视频将您带到这里,在他的 bash_profile.sh 中设置了一些脚本或别名,并安装了PG-CLI以使用终端在本地对 createdb 执行此操作。

如何以本机方式执行此操作的解决方案:不会通过在终端中运行createdb来创建数据库。首先从EDB 安装程序站点安装 postgresql 服务器,该站点提供了运行 postgresql 服务器的所有工具以及一个名为pgAdmin的客户端来与您的 postgresql 服务器交互。

一旦你安装了所有的要求。打开 pgAdmin 并创建数据库,如下图所示。 在此处输入图像描述

如果您在通过 mikro-orm 从项目迁移到 postgresql 时遇到问题,请告诉我。我可以搭把手

于 2021-07-02T21:09:44.107 回答