goravel icon indicating copy to clipboard operation
goravel copied to clipboard

✨ [Feature] Possible support of non sql databases?

Open tekpriest opened this issue 1 year ago • 3 comments

Before feedback (在反馈之前)

  • [X] There are no features that I want to submit in Issues (当前 Issues 中没有我将要提交的新功能)

Describe Feature (描述功能)

Will non sql databases be supported later?

tekpriest avatar Sep 24 '24 00:09 tekpriest

Yes, maybe, you can leave more thoughts about it here.

hwbrzzl avatar Sep 24 '24 03:09 hwbrzzl

maybe a custom database driver that can be set in the config/database.go file, we can have a facades.Orm().Doc()... to indicate it is a document database

tekpriest avatar Sep 26 '24 05:09 tekpriest

facades.Orm().Doc() is a good idea, we also have such a plan. And we will separate DB drivers in the future, will have an interface at that time.

hwbrzzl avatar Sep 26 '24 07:09 hwbrzzl

@hwbrzzl when I developed this package https://github.com/portofolio-mager/goravel-mongodb, I noticed the current goravel codebase is tightly coupled with the ORM (especially GORM).

And we will separate DB drivers in the future, will have an interface at that time.

I’m not familiar with all the ORM-related code, but could you walk me through creating a DB interface that can work with a NoSQL database?

tonidy avatar Oct 17 '25 02:10 tonidy

@tonidy We had separated DB drivers, e.g. https://github.com/goravel/postgres. For the non-sql databases, we may be implement it like https://github.com/mongodb/laravel-mongodb. And maybe not all orm functions are adapted to the mongodb driver, it's fine to implement partial functions.

hwbrzzl avatar Oct 17 '25 04:10 hwbrzzl

I'm closing this issue because Goravel has supported custom database drivers since v1.16.x. A third-party driver implementing github.com/goravel/framework/contracts/database/driver.Driver can be used with the framework.

devhaozi avatar Dec 15 '25 20:12 devhaozi