huntlabs / hunt-entity

An object-relational mapping (ORM) framework for D language (Similar to JPA / Doctrine), support PostgreSQL and MySQL.

Home Page:https://www.huntlabs.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why not use ddbc as database backend?

ximion opened this issue · comments

Hi!
This is more a question than an actual issue report.
At the moment I am looking into what it would take to replace HibernateD in a bunch of projects with Entity, and what additional features I'd have to contribute to Entity to make that transition work.
Some of the missing bits would have to be added to the "database" library instead though.

This made me wonder: Why does Entity use a newly developed database abstraction layer instead of reusing ddbc or a fork of it? The ddbc library has been tested for a long time in many projects and is very mature, while "database" still has a bit to go. It also supports PostgreSQL, MySQL, SQLite and ODBC which pretty much covers any popular relational database already.
DDBC also was - for Postgres - a bit faster than "database".

Hi @ximion :
Thanks your question.
ddbc depends too many third-party components.
hunt's database still under development, I'll improve its performance.
You can improve with us if you need.

@zoujiaqing The only dependencies ddbc has are on database bindings for D for the respective supported databases (SQLite, Postgres, MySQL, etc.). Personally, I like the "just embed the bindings" approach your database module has better.

You could also have achieved that level of integration by just forking ddbc and adding in the bindings (as it's done in "database").
As it looks like at the moment we will be using entity as a replacement for hibernated soonish, because the latter isn't really viable. When that happens, I'll need to look into how to achieve feature/performance parity between ddbc and database (<- the name "database" is really weird to use in conversations ^^).

@ximion We will be rewrite hunt-database project :)

@zoujiaqing Thank you, I think my question is answered. It's a bit sad that so much new code is written from scratch, but these new projects are actively maintained and even have company backing (always a plus!).
I will do some more tests with them any maybe attempt a migration away from Hibernated soon (likely adding some missing things to database/entity, like support for JSON/JSONB fields for Postgres, and custom database data types).
Thanks for your reply! :-)