0

so i'm trying to createdb in visualstudio code with mikro-orm and postgresql but there's an error:

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

Before that i installed mikro-orm and postgresql with yarn, but it doesn't seem to work.

Carl
  • 345
  • 5
  • 23
  • What command are you running? The database won't be created automatically on `MikroORM.init()`. – Martin Adámek May 15 '21 at 17:29
  • i'm running "createdb" in powershell, but i don't know, should i run MikroORM.init()? – Carl May 15 '21 at 18:02
  • My point is that you are not doing anything MikroORM related, you are trying to use pg CLI. Also nothing vscode related. Cant help much, never used the PG CLI myself, but I can see how this question is being wrongly named, so not much PG experts are attracted if the question is about a tool they might never heard of or an editor they don't use. – Martin Adámek May 17 '21 at 08:42
  • Maybe its about powershell? https://stackoverflow.com/questions/24156451/powershell-the-term-is-not-recognized-as-cmdlet-function-script-file-or-operable – Martin Adámek May 17 '21 at 08:43

1 Answers1

1

There is no option as mentioned in mikro-orm documentation to create a db using createdb mikro-orm docs .

The video you were following which led you here has setup some scripts or aliases in his bash_profile.sh and installed PG-CLI to do this locally to createdb using terminal.

Solution to how to do it the native way: The database wont be created by running createdb in terminal. First install postgresql server from EDB Installer site which gives all the tools to run your postgresql server and also a client called pgAdmin to interact with your postgresql server.

Once you have installed all the requirements. Open pgAdmin and create the data-base as shown in the image below. enter image description here

Incase you are having trouble ahead on how the migrations happen from your project to postgresql through mikro-orm, let me know. I can help

raja emani
  • 151
  • 1
  • 4