IrenejMarc / dpq

Simple but powerful PostgreSQL library inspired by higher-level languages.
MIT License
21 stars 9 forks source link

Transaction support and some other improvements #20

Closed Betelgeyser closed 7 years ago

Betelgeyser commented 7 years ago

Added:

IrenejMarc commented 7 years ago

Hey, thanks a great deal for this, it looks great.

Transaction support is great, and seems quite complete. Thanks!

I have a few comments regarding array insertion; the idea is great and the implementation is good too, but ElementType can cause problems (unless this has changed since I last checked) and I therefore have my own implementation of that in dpq.meta, called BaseType that also strips Typedefs and qualifiers since those can cause problems in some cases.

Class deserialisations looks good, I can't believe I forgot that.

findL support seems fine too, but all the find methods on Connection are getting deprecated slowly in lieu of RelationProxy. This is not a merge-stopper, I'll still merge this, but maybe if you have the time and will, consider adding limiting functions to RelationProxy too (it's not a lot of work at all). In the future, I'll also mark findL deprecated if work on RelationProxy continues.

I also very much appreciate the docs and unit tests.

Betelgeyser commented 7 years ago

Current transactions implementation should cover most cases, but it might need some more work still.

Concerning ElementType, I didn't consider that problem, I will fix this soon.

I didn't know about RelationProxy purpose as it wasn't mentioned in the main example, but it seems more suitable for my use case and easier to extend. Thanks for pointing out it, I'll try it out.

IrenejMarc commented 7 years ago

Yeah, I really need to update the readme. As mentioned, I'm slowly deprecating all the Connection's finder methods and moving to the RelationProxy, I feel like it provides a more readable abstraction over the ORM part of the library and is also better separated from other unrelated connection stuff.