7

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.

Tola
  • 2,401
  • 10
  • 36
  • 60
Gainster
  • 5,481
  • 19
  • 61
  • 90

7 Answers7

1

So far I've found following ORM's that support WP7:

Hope it helps somebody.

Mike Eshva
  • 1,078
  • 15
  • 17
1

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
  • 66,480
  • 18
  • 94
  • 155
  • afaik, Windows Phone 7 apps do not run on the Compact Framework, they are developed using Silverlight or XNA. – Lucas Oct 11 '10 at 15:01
  • 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 Oct 11 '10 at 15:15
  • So SL on WP7 runs on the CF, not the CoreCLR? Afaik, CoreCLR and CF are two different runtimes, although their assemblies are compatible. Time for some research, thanks! – Lucas Nov 02 '10 at 15:01
  • Correct, it's use the CF, not CoreCLR. They are not necessarily "compatible". A CoreCLR (i.e. full framework) assembly will not work on the phone. A phone assembly *may* work under CoreCLR. The source code is more portable than the actual compiled assemblies. And yes, this is all a bit confusing. – ctacke Nov 02 '10 at 15:28
1

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
  • 4,029
  • 1
  • 26
  • 35
0

Isn't the elephant in the room Linq to SQL, as this comes with the phone with no additional dependencies (since Mango)?

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
0

A questions has been asked about Subsonic support for SQLite at 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.

Community
  • 1
  • 1
Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • 1
    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 ? – Gainster Sep 07 '10 at 14:12
  • @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 Sep 08 '10 at 08:15
  • "there are no officially supported databases on the platform yet".. and you hit the spot. – Lucas Oct 11 '10 at 15:03
0

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...

MatthieuGD
  • 4,552
  • 2
  • 30
  • 29
0

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
  • 1,232
  • 11
  • 30