Giter VIP home page Giter VIP logo

Comments (7)

yedf2 avatar yedf2 commented on May 17, 2024 1

您好,这两天研究了一下postgresql的支持,结论是要想做到同时支持mysql和postgresql,那么就得把所有的sql,用多数据库支持的orm,这回导致dtm的客户端很重,预计不会那么快去做这方面的工作。

dtm的服务端使用了gorm,支持postgres,目前我在dtm加了postgres分支,这个分支下,能够跑通saga的例子。

from dtm.

yedf2 avatar yedf2 commented on May 17, 2024

这个在计划中,目前dtm仅仅依赖了gorm,不依赖底层具体是什么数据库。
后续会在postgresql上面做测试,给出示例

from dtm.

XIELongDragon avatar XIELongDragon commented on May 17, 2024

您好,这两天研究了一下postgresql的支持,结论是要想做到同时支持mysql和postgresql,那么就得把所有的sql,用多数据库支持的orm,这回导致dtm的客户端很重,预计不会那么快去做这方面的工作。

dtm的服务端使用了gorm,支持postgres,目前我在dtm加了postgres分支,这个分支下,能够跑通saga的例子。

是否可以考虑使用github.com/doug-martin/goqu 这样更轻量级的包而不是厚重的orm?

from dtm.

yedf2 avatar yedf2 commented on May 17, 2024

@XIELongDragon 对于dtm服务器来说,用gorm的代价还好,反正一个服务,最后生成的文件不大。dtmcli是单独拆出来的包,不依赖gorm的,对使用dtm的程序来说,不会因为dtm,引入gorm
看了你推荐的库,貌似没有对高级功能例如insert ignore的支持,而dtm用到了

from dtm.

XIELongDragon avatar XIELongDragon commented on May 17, 2024

insert ignore你是指记录如果存在就skip吗?有呀

                           tx.
				Insert(yourTable).
				Rows(yourData).
				OnConflict(goqu.DoNothing()).
				Executor().
				Exec()

还是指某些field在插入是应该忽略?也是有的

type MyData struct {
    ID            uint64 `db:"id" goqu:"skipinsert,skipupdate"`
}

from dtm.

yedf2 avatar yedf2 commented on May 17, 2024

收到,这个留待后续优化,或者社区有人帮忙做了这个事情,可以合并进来

from dtm.

yedf2 avatar yedf2 commented on May 17, 2024

@sb-child postgresql已完整支持 https://dtm.pub/character/supported-db.html

from dtm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.