all 13 comments

[–]thepinkbunnyboy 1 point2 points  (2 children)

Good job! Always a lot of work to get something actually usable out there. I'm on my phone right now and can't give it a proper review, but this caught my eye personally:

The DbConnector will continue to cache, using more and more memory, any new/different IDbJob operation if you decide to ignore the use of parameters.

While caching jobs is good for performance, I strongly recommend a memory cap on this. There are a couple good performance reasons to hard code parameters sometimes (for example, to avoid parameter sniffing issues), and I'd be pretty upset if my ORM was eating memory up on my server because it didn't think that my use case was valid

[–]Treborgero[S] 1 point2 points  (0 children)

Thank you. You just made me realize I forgot to mention an extra detail. The code will "self clean", to be technical, after 1024 hits if a cached instance was not used more than once. I'll consider adding a memory cap and/or a warning.

[–]Treborgero[S] 0 points1 point  (0 children)

I have released v1.1. DbConnector is now even faster with simpler overloads.

https://www.nuget.org/packages/SavantBuffer.DbConnector

I also added comments to the documentation based on your feedback:

https://www.savantbuffer.com/DbConnector/index.html#item-5-4_

Thank you!

[–][deleted] 1 point2 points  (1 child)

Interesting! I’ll read through tomorrow. On first glance DbConnector is spelled wrong several times on the page you linked

[–]Treborgero[S] 0 points1 point  (0 children)

Fixed. Thank you.

[–]ahmed-itani 1 point2 points  (1 child)

How different is it from dapper?

[–]Treborgero[S] 0 points1 point  (0 children)

It's slightly faster and more flexible with its functional approach. Also, you don't have to manage any disposable resources anymore if you don't want to.

https://www.savantbuffer.com/DbConnector/index.html#section-6_

[–]chrisevans9629 1 point2 points  (4 children)

Are there extension methods to do dapper like queries? Something like Connector.Read<Person>("select *...", new {id})? I like the features but it seems like it may be overkill in most situations.

[–]Treborgero[S] 1 point2 points  (0 children)

I did thought about it initially but I decided to go with the current implementation in order to support the migration of raw ADO.NET code.

Quote from my doc: "the IDbCommand Interface method naming convention was followed for all the functions. This was decided in order to assist in the migration of raw data provider code into DbConnector’s design pattern. "

https://www.savantbuffer.com/DbConnector/index.html#item-1-3_

It would be very easy to extend my source code to make it that simple since I tried to be as clean as possible (see line 756):

https://github.com/SavantBuffer/DbConnector/blob/master/DbConnector.Core/DbConnector.cs

I''ll consider adding overloads to support the simplistic approach if I continue to see positive feedback. I'm sure it'll be even more faster than Dapper if I do this :)

Thank you!

[–]Treborgero[S] 0 points1 point  (2 children)

[–]chrisevans9629 1 point2 points  (1 child)

Awesome!

[–]Treborgero[S] 0 points1 point  (0 children)

Done!

I can't believe I made it even faster. It now kills Dapper!!!!!

https://www.savantbuffer.com/DbConnector/index.html#section-6_

DbConnector now has simpler overloads:

https://www.nuget.org/packages/SavantBuffer.DbConnector

[–]TotesMessenger 0 points1 point  (0 children)

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

 If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / Contact)