英文:
Hood "config.json" values
问题
我对hood
的文档有一些问题,关于config.json
中应该包含什么内容没有解释。
我尝试了以下配置:
{
"development": {
"driver": "postgres",
"source": "my_development"
}
}
但是我遇到了错误:
hood db:migrate
2014/06/23 12:53:14 应用迁移...
panic: 在连接信息字符串中的"my_development"后缺少"="号
英文:
I have some problems with documentation for hood
, there no explanation about what supposed to be in config.json
.
I've tried:
{
"development": {
"driver": "postgres",
"source": "my_development"
}
}
but I have the error:
hood db:migrate
2014/06/23 12:53:14 applying migrations...
panic: missing "=" after "my_development" in connection info string"
答案1
得分: 2
从hood文档中:
driver和source字段是你将传递给sql.Open(2)函数的字符串。
所以driver
的值应该是postgresql
(对于你的示例),而source
的值应该是一个key=value
列表或一个完整的连接URI(如postgresql文档中所述)。
一些示例(来自这里):
postgres://pqgotest:password@localhost/pqgotest?sslmode=verify-full
user=pqgotest dbname=pqgotest sslmode=verify-full
英文:
From the hood documentation :
> The driver and source fields are the strings you would pass to the sql.Open(2) function.
So the driver
value should be postgresql
(for your example), and the source
value should be either a list of key=value
or a full connection URI (like described in the postgresql documentation).
Some examples (from here) :
postgres://pqgotest:password@localhost/pqgotest?sslmode=verify-full
user=pqgotest dbname=pqgotest sslmode=verify-full
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论