依赖 github yggdrasill
#!/bin/bash
echo '开始创建struct'
echo -n "输入数据库连接:"
read host
echo -n "输入数据库端口号:"
read port
echo -n "输入数据库用户名:"
read name
echo -n "输入数据库密码:"
read pwd
echo -n "输入数据库名称:"
read dbname
echo -n "输入数据库表名:"
read tablename
echo "yggdrasill -target=pg -dsn=\"$host user=$name password=$pwd dbname=$dbname port=$port sslmode=disable TimeZone=Asia/Shanghai\" -table_names=$tablename"
exit 0