13 Replies
Can you give us an idea what command you’re running and the error/expected output?
Basically just any more context is helpful. Thanks
I want to db seed my production so im using this in my .env.server
DATABASE_URL=<my-db-url> wasp db seed myProdSeed
But it fails to parse it when building
unexpected 'w'
expecting end of input or end of line
)
Wohooo @wasper, you just became a Waspeteer level 1!
Oh ok. Yeah unfortunately that file is for environment variables only
You will need to run that command from a terminal or some script for it to execute
I’m referring to the wasp db seed part btw
So I have to have server access on my railway instance and execute it from there
Yeah some remote shell or scriptable access. I haven’t used Railway but @Vinny (@Wasp) does. Maybe he can chime in tomorrow after the holiday if he has run seeds there
if you're using railway
You can install their CLI, connect to the project and then do
railway run "whatver command you want"
And that command will be run with servers ENVThanks, that did it.
I was under the impression that you could specify it in the .env.server variable and will be automatically executed on deploy
Nope,
.env.server
is just an ENV file that your local server loads in devI've seeded railway db by setting it's connection string to local .env.server's DATABASE_URL and then running wasp db seed
Just to check, it can't be run from the local machine, with the URL of the Railway DB? Is Railyway protecting against that?
If so, then yes, you will need to run it somewhere from Railway!
@wasper btw seeding is somewhat new in Wasp, so if you have some ideas what to improve, we are happy to listen!
Pretty sure this was the error with how wasp was loading the envs?
and not with railways URL since
railway run
esentially does the same thingYup, wrong usage of .env.server -> trying to give it a command, instead of just passing an env var value.
I just wasn't sure if railway would allow accessing the production db from the outside, but based on what fossfighter said, seems it does, which makes this easier.