www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - D need an ORM library!

reply binghoo dang <dangbinghoo gmail.com> writes:
hi,

I thinks D need an ORM library for Sqlite/Mysql/PostgreSQL, 
entity currently support all the three targets, but entity's API 
is too complex and cumbersome for using.

Is there a more light-weight and simpler implementation like 
ActiveAndroid ?

Thanks!


---

Binghoo Dang
Aug 19 2018
next sibling parent reply Jesse Phillips <Jesse.K.Phillips+D gmail.com> writes:
On Monday, 20 August 2018 at 02:30:16 UTC, binghoo dang wrote:
 hi,

 I thinks D need an ORM library for Sqlite/Mysql/PostgreSQL, 
 entity currently support all the three targets, but entity's 
 API is too complex and cumbersome for using.

 Is there a more light-weight and simpler implementation like 
 ActiveAndroid ?

 Thanks!


 ---

 Binghoo Dang
There are a number of things out there, but personally don't know there state or simplicity. 2016 there was a talk: http://dconf.org/2016/talks/nowak.html But personally I preferred this one: http://dconf.org/2016/talks/smith.html https://github.com/cruisercoder/dstddb
Aug 20 2018
next sibling parent Russel Winder <russel winder.org.uk> writes:
On Mon, 2018-08-20 at 15:58 +0000, Jesse Phillips via Digitalmars-d-
learn wrote:
 On Monday, 20 August 2018 at 02:30:16 UTC, binghoo dang wrote:
 hi,
=20
 I thinks D need an ORM library for Sqlite/Mysql/PostgreSQL,=20
 entity currently support all the three targets, but entity's=20
 API is too complex and cumbersome for using.
Can I suggest that SQLAlchemy is excellent. It has the full on ORM for those that want it, but also an expression language so you do not have to write SQL in strings if you are not using the ORM.=20 Being able to write Python that generated SQL (Builder pattern) has made working with SQLite almost a joy.
 Is there a more light-weight and simpler implementation like=20
 ActiveAndroid ?
=20
 Thanks!
=20
=20
 ---
=20
 Binghoo Dang
=20 There are a number of things out there, but personally don't know=20 there state or simplicity. =20 2016 there was a talk: http://dconf.org/2016/talks/nowak.html =20 But personally I preferred this one:=20 http://dconf.org/2016/talks/smith.html https://github.com/cruisercoder/dstddb
--=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Aug 20 2018
prev sibling parent reply Matthias Klumpp <matthias tenstral.net> writes:
On Monday, 20 August 2018 at 15:58:37 UTC, Jesse Phillips wrote:
 [...]

 There are a number of things out there, but personally don't 
 know there state or simplicity.

 2016 there was a talk: http://dconf.org/2016/talks/nowak.html

 But personally I preferred this one: 
 http://dconf.org/2016/talks/smith.html
 https://github.com/cruisercoder/dstddb
This all looks very dead. Is there any project still alive? The only effort that still seems to be actively developed as far as I can see is hunt-entity... And I agree, SQLAlchemy is pretty great!
Aug 20 2018
parent reply binghoo dang <dangbinghoo gmail.com> writes:
On Monday, 20 August 2018 at 23:24:04 UTC, Matthias Klumpp wrote:
 On Monday, 20 August 2018 at 15:58:37 UTC, Jesse Phillips wrote:
 [...]

 There are a number of things out there, but personally don't 
 know there state or simplicity.

 2016 there was a talk: http://dconf.org/2016/talks/nowak.html

 But personally I preferred this one: 
 http://dconf.org/2016/talks/smith.html
 https://github.com/cruisercoder/dstddb
This all looks very dead. Is there any project still alive? The only effort that still seems to be actively developed as far as I can see is hunt-entity... And I agree, SQLAlchemy is pretty great!
yeah, Only entity is likely a living ORM implementation in D. But, it's API is too complicated, and API is not stable from my experience. SQLAlchemy is very great, and I remember that <GSOC 2018 Ideas> in D wiki has mentioned this, but the status is "Proposed Project Mentors: TBA".
Aug 20 2018
parent reply Russel Winder <russel winder.org.uk> writes:
On Tue, 2018-08-21 at 01:42 +0000, binghoo dang via Digitalmars-d-learn=20
wrote:
[=E2=80=A6]
=20
 SQLAlchemy is very great, and I remember that <GSOC 2018 Ideas>=20
 in D wiki has mentioned this, but the status is "Proposed Project=20
 Mentors: TBA".
SQLAlchemy is how SQL building and ORM should be done, in Python. For other programming languages it has to be an inspiration, but not used as a template for an API =E2=80=93 different languages encourage different idiomatic solutions to the same problem. I know of a C++11 variant that had the same approach as SQLAlchemy but done in C++1 idiomatic style, but then I stopped using C++. I haven't looked for a Rust version yet, but I am hoping one is there. If there was a D version of SQLAlchemy, that would be wonderful. Feel free to s/TBA/Russel Winder/ --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Aug 21 2018
parent binghoo dang <dangbinghoo gmail.com> writes:
On Tuesday, 21 August 2018 at 08:22:34 UTC, Russel Winder wrote:

 If there was a D version of SQLAlchemy, that would be 
 wonderful. Feel free to s/TBA/Russel Winder/
Great! there are many people waiting for this! ^_^
Aug 21 2018
prev sibling parent reply bauss <jj_1337 live.dk> writes:
On Monday, 20 August 2018 at 02:30:16 UTC, binghoo dang wrote:
 hi,

 I thinks D need an ORM library for Sqlite/Mysql/PostgreSQL, 
 entity currently support all the three targets, but entity's 
 API is too complex and cumbersome for using.

 Is there a more light-weight and simpler implementation like 
 ActiveAndroid ?

 Thanks!


 ---

 Binghoo Dang
Currently (When I get time again) working on implementing PostgreSQL and Sqlite support for Diamond. Mysql and Mssql should work out the box. https://github.com/DiamondMVC/Diamond Some examples will come later, unless you use the latest stable version of Diamond then you have examples for MySql, but the implementation changes with the next release. http://diamondmvc.org/docs/data/#database I wouldn't call it light-weight like you explain, because it does have the whole framework, but you could technically just strip out the part of compile it with the appropriate flags to exclude the parts you don't need like the webserver. Else take a look at https://github.com/buggins/hibernated and perhaps https://github.com/buggins/ddbc is enough.
Aug 21 2018
parent reply binghoo dang <dangbinghoo gmail.com> writes:
On Tuesday, 21 August 2018 at 10:48:30 UTC, bauss wrote:

 Currently (When I get time again) working on implementing 
 PostgreSQL and Sqlite support for Diamond.

 Mysql and Mssql should work out the box.

 https://github.com/DiamondMVC/Diamond

 Some examples will come later, unless you use the latest stable 
 version of Diamond then you have examples for MySql, but the 
 implementation changes with the next release.

 http://diamondmvc.org/docs/data/#database

 I wouldn't call it light-weight like you explain, because it 
 does have the whole framework, but you could technically just 
 strip out the part of compile it with the appropriate flags to 
 exclude the parts you don't need like the webserver.

 Else take a look at https://github.com/buggins/hibernated and 
 perhaps https://github.com/buggins/ddbc is enough.
yeah, Diamond is great, but I think it will be more wonderful if it's database ORM can be separated to a standalone project, that's would be useful for the application that's is not WEB oriented but need an ORM.
Aug 21 2018
next sibling parent reply bauss <jj_1337 live.dk> writes:
On Wednesday, 22 August 2018 at 06:14:40 UTC, binghoo dang wrote:
 On Tuesday, 21 August 2018 at 10:48:30 UTC, bauss wrote:

 Currently (When I get time again) working on implementing 
 PostgreSQL and Sqlite support for Diamond.

 Mysql and Mssql should work out the box.

 https://github.com/DiamondMVC/Diamond

 Some examples will come later, unless you use the latest 
 stable version of Diamond then you have examples for MySql, 
 but the implementation changes with the next release.

 http://diamondmvc.org/docs/data/#database

 I wouldn't call it light-weight like you explain, because it 
 does have the whole framework, but you could technically just 
 strip out the part of compile it with the appropriate flags to 
 exclude the parts you don't need like the webserver.

 Else take a look at https://github.com/buggins/hibernated and 
 perhaps https://github.com/buggins/ddbc is enough.
yeah, Diamond is great, but I think it will be more wonderful if it's database ORM can be separated to a standalone project, that's would be useful for the application that's is not WEB oriented but need an ORM.
Diamond works without web though. You can disable all web features and simply just import the modules for the orm etc. The ORM was used to be standalone, but became a huge dependency, so was just integrated into it. I would suggest
Aug 22 2018
parent bauss <jj_1337 live.dk> writes:
On Wednesday, 22 August 2018 at 09:33:26 UTC, bauss wrote:
 I would suggest
Accidentally pressed "Send", but as I was saying. I would suggest https://github.com/buggins/hibernated as an alternative.
Aug 22 2018
prev sibling parent Russel Winder <russel winder.org.uk> writes:
On Wed, 2018-08-22 at 06:14 +0000, binghoo dang via Digitalmars-d-learn=20
wrote:
[=E2=80=A6]
 yeah, Diamond is great, but I think it will be more wonderful if=20
 it's database ORM can be separated to a standalone project,=20
 that's would be useful for the application that's is not WEB=20
 oriented but need an ORM.
Possibly, but possibly not. Django has an ORM, but SQLAlchemy happened as well. --=20 Russel. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
Aug 22 2018