views:

254

answers:

5

I thinking of using SQLite with win7 phone for development of my app. I looking for an ORM mapper which will work with Windows 7 phone and SQLite.

A: 

A questions has been asked about Subsonic support for SQLite at http://stackoverflow.com/questions/3652066/sqlite-and-sub-sonic

However, as there are no officialliy supported databases on the platform yet, I've not seen anyone attempt to write a generic ORM for the various database implementations people have created.

Matt Lacey
it is not the same question. here I am asking if there any ORM which work with Win7 phone. while I am asking if Subsonic can work ?
Huzaifa
@Huzaifa I know it's not the same question. That's why I didn't flag it as a duplicate. I was simply highlighting a related question.
Matt Lacey
"there are no officially supported databases on the platform yet".. and you hit the spot.
Lucas
A: 

There's Perst : http://www.mcobject.com/perst. I'm using it now, not a lot of feedback yet. It uses ActiveRecord as persistance pattern. Not a lot of documentation etc. but it exists so ... An example here : http://mobileworld.appamundi.com/blogs/andywigley/archive/2010/06/07/perst-a-database-for-windows-phone-7-silverlight.aspx

http://siaqodb.com/ : seems promising but not free

SQLLite would be cool, there's a full C# implementation available on Silverlight, so WP7 is not so far away. There's this POC http://sviluppomobile.blogspot.com/2010/03/sqlite-for-wp-7-series-proof-of-concept.html but it's only SQlLite, no object APi to query, store etc...

Matthieu
A: 

I created a lightweight, extensible ORM for the Compact Framework. While my reference implementation uses SQL Compact, I know one developer who got it working with SQLite on WinPhone in less than a day by simply following the SQL Compact version as a template. I've been meaning to do that port myself, I've just not found the time.

It's probably worth noting at this point that he also abandoned it because SQLite (not the ORM framework) was very, very slow.

ctacke
afaik, Windows Phone 7 apps do not run on the Compact Framework, they are developed using Silverlight or XNA.
Lucas
Windows Pnone's XNA and SL frameworks run on top of the Compact Framework. It uses version 3.7 IIRC, which is unreleased outside of Phone, but can still consume earlier CF assemblies (assuming they don't use something the phone disallows, like P/Invokes). I actually did add a little to the ORM project to add the SQLite binaries and implemented the table creation pieces as "seed" for the industrious.
ctacke
+1  A: 

If you are not convinced of using SQLite, you should give Db4o a try. It is an object oriented database, so you won't need an ORM tool (assuming that you just want object mapping). Also, it supports linq queries.

Fernando
A: 

You might want to have a look at sqlite-net. The original library is actually targetted for Mono and MonoTouch, but there is also a port to Compact Framework. It contains a simple ORM. To be able to run sqlite on WP7 may be a bit tricky (has to use Isolated Storage), but you can try using this proof of concept library.

Michał Drozdowicz