Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Postgresql config #2

Open
Orokapei opened this issue Sep 15, 2023 · 2 comments
Open

Postgresql config #2

Orokapei opened this issue Sep 15, 2023 · 2 comments

Comments

@Orokapei
Copy link

database:
  type: mysql
  dsn: root:123456@tcp(127.0.0.1:3306)/longurl?parseTime=true

这里的配置如果用postgres的话type需要填什么= =填什么都是unknown type
自己搜了下ent的文档 https://entgo.io/docs/sql-integration/#use-pgx-with-postgresql
db/client.go如果要支持postgres是不是要用pgx驱动

    "entgo.io/ent/dialect"
    _ "github.com/jackc/pgx/v5/stdlib"
@long2ice
Copy link
Owner

你更新一下最新的源码然后填pgx试试

@Orokapei
Copy link
Author

非常抱歉,才看到,试了一下会提示如下错误

FATA[0000] Failed creating schema resources: sql/schema: unsupported dialect "pgx"

= =整不来postgres,暂时用mysql了

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants