jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM
Other
861 stars 145 forks source link

Looking for Sample Project #375

Closed sergioza closed 6 years ago

sergioza commented 6 years ago

Hi,

Trying to eval Insight.Database, so i wonder if there are any sample projects available using Insight.Database?

and also

How Insight.Database functionality different/advantageous vs Dapper? Does it also provide any CRUD methods not to simplify basic CRUD operations instead of submitting SQL or SPs?

Many Thanx

jonwagner commented 6 years ago

Have you seen the documentation at the wiki?

https://github.com/jonwagner/Insight.Database/wiki

sergioza commented 6 years ago

Thank You Much Jon,

Documentation is very good, i thought that there might be some sample project additionally. and also How Insight.Database functionality different/advantageous vs Dapper (another common micro ORM)? Does it also provide any CRUD methods not to simplify basic CRUD operations instead of submitting SQL or SPs?

Many Thanx

jonwagner commented 6 years ago

There is a sample project in one of the directories in the code.

The main differences between Insight and other ORMs:

If you are looking for an ORM that generates SQL for you, there are probably better options, but if you have a database with existing stored procedures, you won't find anything better.

Jaxelr commented 6 years ago

If you are looking for some basic performance comparison, i added Insight into this OrmBenchmark repo. It does include Dapper, Ef, petapoco, ormlite, simpledata, to name a few.

In my opinion Insight shines through on:

ThisNoName commented 6 years ago

Insight.Database is the most ingenious ORM solution I have ever encountered, especially the auto interface!

If there's one thing I wish to change, is how it handles relations. Right now for

class Beer
{
    public int ID;
    public IList<Glass> Glasses;
}

it requires

CREATE PROC GetBeerAndPossibleGlasses AS
    SELECT * FROM Beer
    SELECT b.BeerID, g.* FROM Beer JOIN Glasses ON (...)

while most SQL are written like

   SELECT * FROM Beer LEFT JOIN Glasses ON (...)

Often, on large projects with database developer involved, or existing or vendor database, we don't always have the option to enforce a different style coding stored procedures, even if it's arguably more efficient under circumstances.

This prevents me from using Insight.Database in almost all but the greenest projects. Really wish we could have some options here, maybe an alternative implementation to specify result structure traditional style?

jonwagner commented 6 years ago

One of the reasons Insight is so elegant is that we built it assuming that you would have some control over the object model and the stored procedures. That lets us have some really nice features without having to have complicated mapping or SQL generation rules.

I think we can support this use case. I opened a new issue to track it.

Since you found the sample code, I'll close this out, but you can follow #378 for the new feature.