LINQ with SQLite (linqtosql)

LinqLinq to-SqlSqlite

Linq Problem Overview


I have a small project that require a storage (I choose SQLite) and I got good result with the ADO DLL for .Net for Sqlite.

After the Install, I noticed that it contain a SQLLinq.dll. Before investigating too much effort, and because I haven't see any good example on the web, I would like to know if anyone got any good result with SQLite and LINQ?

*If linqtosql work the same way what ever the SQL database, let me know it. I was interesting with the Dll when I saw it because I never use Linqtosql before and I thought it would be a great opportunity to try,

Linq Solutions


Solution 1 - Linq

I've recently discovered DBLinq, which supports SQLite among other DB:

Solution 2 - Linq

From my own experience, Microsoft SQL Compact Framework is a REAL NO-GO. It is REALLY FREAKING slow and its Query Analyzer is just really poor. I had to ask my team to rewrite all the plumbing code of my Windows Mobile component to get rid of the awful performances of SQL CE.

Solution 3 - Linq

LINQ to SQL only supports SQL Server/Compact however it is possible the SQLite people have written their own LINQ provider given the name of the assembly.

If that's the case you would be able to use the LINQ query syntax by adding a reference to it but you wouldn't get LINQ to SQL specific features such as the DataContext/designer/SQL Metal/Column attributes/EntitySet/EntityRef etc.

Solution 4 - Linq

I know this question is old, but at this time, I think we can found an official implementation of SQLite support for .NET here : http://system.data.sqlite.org/index.html/doc/trunk/www/index.wiki. A good introductory article should be found here : http://www.codeproject.com/Articles/236918/Using-SQLite-embedded-database-with-entity-framewo

Solution 5 - Linq

This isn't an answer to your question as such, but as an alternative you could use SQL Compact:

http://www.microsoft.com/Sqlserver/2005/en/us/compact.aspx

Which has good LINQ-to-SQL support, and (despite the name) is great for desktop apps with small storage requirements.

Solution 6 - Linq

There's a package on NuGet called "LINQ to SQLite". I haven't tried it, but it seems fresh.

https://www.nuget.org/packages/linq2db.SQLite/

Solution 7 - Linq

this is a good linq to sqlite..

http://www.devart.com/dotconnect/sqlite/

Solution 8 - Linq

With EntityFramework 7 the support for SqLite improved and it is possible to use the EntityFramework.Commands to create some migrations. Here is a Tutorial:

https://xamlbrewer.wordpress.com/2016/06/01/getting-started-with-sqlite-and-entity-framework-on-uwp/

As a prerequisite at least PowerShell3 should be installed.

Solution 9 - Linq

Since DBLinq is no longer maintained, I kept searching and found this answer which sort of unclearly points to a solution using Linq to Sql, Entity Framework, and SQLite. The blog post he links to is a little out of date, but with some tweaks I got a working example up on GitHub.

It should run OOTB in Visual Studio 2013. It shows adding a record (with related record in another table), modify, and delete. The Artist and Album classes represent records in their respective tables (part of the Entity Framework, I believe). See the readme for a few gotchas to watch out for.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPatrick DesjardinsView Question on Stackoverflow
Solution 1 - LinqRicardo AmoresView Answer on Stackoverflow
Solution 2 - LinqfmarceauView Answer on Stackoverflow
Solution 3 - LinqDamienGView Answer on Stackoverflow
Solution 4 - LinqswdevView Answer on Stackoverflow
Solution 5 - LinqstusmithView Answer on Stackoverflow
Solution 6 - LinqDenNukemView Answer on Stackoverflow
Solution 7 - LinqMatt PetersView Answer on Stackoverflow
Solution 8 - LinqStefanView Answer on Stackoverflow
Solution 9 - LinqVimesView Answer on Stackoverflow