beego / bee

Bee is a tool for helping develop with beego app framework.
Apache License 2.0
1.44k stars 921 forks source link

Why can't I run migrations with bee tool -conn with environment variables #860

Open TheNickFury opened 1 year ago

TheNickFury commented 1 year ago

Hello guys, I'm new to using Beego. I'm trying to use migrations via the command line

bee migrate -driver=postgres -con="host=$host user=$user"

go 1.20.6 bee 2.1.0

but I'm currently struggling to insert environment variables.

Is it possible?

I'm probably doing something wrong... Is there another way to perform migrations? Perhaps using the orm.RunSyncdb method?

flycash commented 12 months ago

-conn?

TheNickFury commented 12 months ago

Yes sorry -conn.. how do I put environment variables inside the connection?

flycash commented 12 months ago

I check the docs but do not find the related usage case. But I think you can use the linux command like -conn=(cat >xxx).

flycash commented 12 months ago

sorry, I am not good at linux command, you can google it.