所以我试图用 mikro-orm 和 postgresql 在visualstudio 代码中创建,但有一个错误:
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
在那之前,我用纱线安装了 mikro-orm 和 postgresql,但它似乎不起作用。
答案 0 :(得分:0)
mikro-orm 文档中没有提到使用createdb mikro-orm docs 创建数据库的选项。
您所关注的视频在他的 bash_profile.sh 中设置了一些脚本或别名,并安装了 PG-CLI 以使用终端在本地执行此操作。
如何以本机方式执行此操作的解决方案: 不会通过在终端中运行 createdb 来创建数据库。 首先从 EDB Installer site 安装 postgresql 服务器,它提供了运行您的 postgresql 服务器的所有工具以及一个名为 pgAdmin 的客户端以与您的 postgresql 服务器交互。
一旦您安装了所有要求。打开 pgAdmin 并创建数据库,如下图所示。
如果您在如何通过 mikro-orm 从项目迁移到 postgresql 方面遇到问题,请告诉我。我可以帮忙