The whole purpose of the ORM is so that we don't have to use string types for accessing our data.
I don't agree. An ORM should map to strong types as conventionally and idiomatically as possible, but they can just as easily be queried using SQL.
For common simple queries we can provide a typed API where possible but for joins and the like my preference is to use SQL.
i.e. It's great when we can have a strong-typed API but I get by just as easily when it's not available.
If we wanted to do that we could just use embedded SQL in the project.
Good idea, SQL is a DSL for querying an RDBMS, For complex queries I prefer using SQL than working with a leaky abstraction that I have no idea what SQL gets generated.
Rather, we are using an ORM to create our database from our strong .NET data types. It allows us to easily refactor our table definitions, add columns, etc. without having to search for strings referencing them.
Right so it still maps to strong types which serve as the master schema for the generated tables. You should only be concerned about your existing queries here since everything else is mapped to your POCO types.
I suggest putting all related queries behind a repository so if you do make a change there's only 1 place to look.
I'm suggesting that we avoid any methods that require us to put in a string to match a property name or a table name or a column name, etc.
And I'm suggesting we come up and agree on the ideal API. i.e. If you're critiquing the current API, come up with a better one to replace it.
The primary goals of the OrmLite is to map to C# types as conventionally as possible via succinct, intuitive DRY APIs that reduce the boilerplate associated with DataAccess.
Since OrmLite is just extension methods around IDbCommand, we're able to orthagonally add new features and DRY overloads side-by-side without restricting access to the ADO.NET data classes or affecting the complexity of the existing APIs.
And OrmLite is not a finished library, especially in regards to the SQL Expression functionality which is fairly new.
My suggestion is for those that need the new APIs to add it them themselves, we're always available here if you need any help.
- Demis
On Thu, Mar 8, 2012 at 6:32 PM, Brannon
<notac...@gmail.com> wrote:
What's API are you suggesting instead?
The whole purpose of the ORM is so that we don't have to use string types for accessing our data. If we wanted to do that we could just use embedded SQL in the project. Rather, we are using an ORM to create our database from our strong .NET data types. It allows us to easily refactor our table definitions, add columns, etc. without having to search for strings referencing them. I'm suggesting that we avoid any methods that require us to put in a string to match a property name or a table name or a column name, etc.