W
Wasp4d ago
fred-123

Can the wasp db studio command be altered to take the connection string directly?

Can the wasp db studio command be altered to take the connection string directly in CLI instead of pulling it from env.server? Long story short, I have a hackintosh that is incapable of virtualization. Docker won't run on it. I am building everything on my laptop, but i would like to be able to at leats access the db in a easy way on the hackintosh. is there a way to set the connection string explicitly in the wasp db studio command?
7 Replies
kapa.ai
kapa.ai4d ago
Hi @fred-123. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the knowledge sources provided, there isn't a direct way to alter the wasp db studio command to take the connection string directly in the CLI instead of pulling it from the .env.server file. However, there are a couple of workarounds you could try: 1. Use environment variables: You can set the DATABASE_URL environment variable inline when running the command. This is mentioned in the Wasp documentation on connecting to databases:
DATABASE_URL=<my-db-url> wasp db studio

DATABASE_URL=<my-db-url> wasp db studio

This method allows you to override the value in .env.server for a specific command execution. 2. Modify the .env.server file: You could temporarily modify the .env.server file on your hackintosh to include the correct DATABASE_URL. The Wasp documentation on environment variables mentions that you can define environment variables in .env.server files. It's worth noting that these solutions assume that your hackintosh can connect to the database running on your laptop. You'll need to ensure that the database is accessible from your hackintosh's network. If these solutions don't work for your specific setup, you might need to consider alternative ways to access your database, such as using a different database management tool that allows direct connection string input. Unfortunately, the knowledge sources don't provide information about directly modifying the wasp db studio command to accept a connection string as an argument. If this functionality is crucial for your workflow, you might want to consider opening a feature request on the Wasp GitHub repository. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @fred-123, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
fred-123
fred-123OP4d ago
i still get this when i run it: app/main.wasp @ 34:17-20 Type error: Undefined identifier: User 33 | auth: { 34 | userEntity: User, 35 | methods: { ❌ --- [Error] Compilation of wasp project failed: -------------------------------- 1 errors found Just to clarify. On this machine i have never run wasp start or any command like this as it doesn't work.
MEE6
MEE64d ago
Wohooo @fred-123, you just became a Waspeteer level 7!
miho
miho4d ago
Overriding like that should work DATABASE_URL=x wasp db studio but it requires that you have wasp installed and that you are running that command from your Wasp's project dir. Can you take me step by step how you are trying to run the command?
fred-123
fred-123OP4d ago
I think thats the catch. Installing wasp requires docker to work. The Computer where i have this issue can't instal wasp since it can't do Virtualization of any type. But i should be able to use something like PgAdmin4 to connect to the db directly right?
miho
miho4d ago
Installing wasp requires docker to work.
Wasp CLI doesn't require Docker to work, only the wasp start db command requires Docker 😄 You should be able to connect to the DB via any DB tool, yep 🙂 make sure the two machines are on the same network
fred-123
fred-123OP3d ago
You are right. That works. For some reason I though the install was all inside the "wasp new" command. Didn't even cross my mind that I can just curl wasp for some reason. Too much coffee or to little coffee. We will never know. Thanks for the help!

Did you find this page helpful?