cryptobi / toolbox

Crypto.BI Toolbox is a tool suite for cryptocurrency enthusiasts.
https://crypto.bi
MIT License
29 stars 12 forks source link

Adding support for PostgreSQL? #1

Open jkugler opened 4 years ago

jkugler commented 4 years ago

Howdy! I just found Crypto.BI Toolbox and I think I'll be setting it up.

I see these files: https://github.com/cryptobi/toolbox/blob/master/db/dao/CBDAO.h https://github.com/cryptobi/toolbox/tree/master/db/dao/mysql

Would implementing PostgreSQL be as "simple" reimplementing CBMySQL.{cpp|h} and having an #ifdef in CBDAO.h or do the dependencies go deeper than that?

Ideally, I'd love it if we could do it completely general to the point of being specify the driver like connection=postgresql://user:pass@host but one step at a time. :)

rektbuildr commented 4 years ago

That should be about it.

On CBDAO.cpp the Mysql driver is hardcoded right now.

Gotta change

_drivers[i] = new mysql::CBMySQL();

to

_drivers[i] = new pgsql::YOURPGSQL();

Then add the build instructions to dao/CMakeLists.txt

add_subdirectory(yourpgsql/)

Ideally, I'd love it if we could do it completely general to the point of being specify the driver like connection=postgresql://user:pass@host but one step at a time. :)

That's the goal!

I haven't had time yet this year to get down to it.

If you got any ideas then please send me your pull requests. Thanks!