Home
Sign Up
Sign In
The Go Programming Language
›
http://golang.org/
›
Go Playground
Go Projects
›
Revel Web Framework
Advertisement
V2EX
›
Go 编程语言
gorm 如何使用 postgresql 中 schema 下的 table
imherer
·
Sep 7, 2020
· 2853 views
This topic created in 2209 days ago, the information mentioned may be changed or developed.
默认 gorm 时都是使用 db 下的 table,那如何使用 db 下 schema 中的 table 呢?
table
gorm
schema
postgresql
2 replies
•
2020-09-09 09:29:39 +08:00
1
xifengzhu
Sep 8, 2020
默认应该是 public 这个 schema 中的 table,gorm 没看到支持这个方面的文档,可以去 github 提个问题。
2
imherer
OP
Sep 9, 2020
@
xifengzhu
谢谢
之前在 GitHub 上看了下有人也提过类似的问题,jinzhu 的回答是通过 db.Table("schema.table") 这样的方式去解决
看来目前只能这样了
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
2578 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms ·
UTC 08:10
·
PVG 16:10
·
LAX 01:10
·
JFK 04:10
♥ Do have faith in what you're doing.
❯