Skip to content

support PostgreSQL Database #33

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 22, 2020
Merged

support PostgreSQL Database #33

merged 5 commits into from
Apr 22, 2020

Conversation

rts-gordon
Copy link
Contributor

  • PR 修复缺陷请先开 issue 报告缺陷
  • PR 提交新特性请先到黑客派发帖讨论
  • PR 请提交到开发分支上
  • 我们对编码风格有着较为严格的要求,请在阅读代码后模仿类似风格提交

Hi @88250
由于我们的项目支持Postgres,所以我在Pipi最新版本2.0的基础上增加了对Postgres的支持,主要修改如下:
1、model/article.go的gorm type mediumtext修改为gorm type text,因为postgres不支持mediumtext,但支持text;
2、service/db.go加载了"github.com/jinzhu/gorm/dialects/postgres" driver;
3、model/confs.go,pipe.json增加了对postgres的参数支持;
4、service/articlesrv.go等文件把SQL语句Select("id")修改为Select(" id "),去掉了``,因为postgres会执行出错。

以上修改在SQLite中测试通过,在Postgres中测试通过,希望Pipe能支持Postgres数据库,扩大产品使用范围。谢谢。

@88250 88250 merged commit 4b977c3 into 88250:postgresql Apr 22, 2020
@88250 88250 linked an issue Apr 22, 2020 that may be closed by this pull request
@88250 88250 mentioned this pull request Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

支持 PostgreSQL 数据库
2 participants