61 ratings
  • 1
  • 2
  • 3
  • 4
  • 5
5 star 33
4 star 9
3 star 10
2 star 4
1 star 5
Compatible with
  • iOS
  • Android
  • Windows

SQLite.NET 1.0.11

Xamarin Inc

Simple, powerful, cross-platform SQLite client and ORM.

SQLite.NET is an open source, minimal library to allow .NET and Mono applications to store data in SQLite 3 databases. SQLite.NET was designed as a quick and convenient database layer. Its design follows from these goals:

  • Very easy to integrate with existing projects and with Xamarin projects.

  • Thin wrapper over SQLite and should be fast and efficient. (The library should not be the performance bottleneck of your queries.)

  • Very simple methods for executing CRUD operations and queries safely (using parameters) and for retrieving the results of those query in a strongly typed fashion.

  • Works with your data model without forcing you to change your classes. (Contains a small reflection-driven ORM layer.)

Non-goals include:

Example

using SQLite;
// ...

public class Note
{
    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }
    public string Message { get; set; }
}

// Create our connection
string folder = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
var db = new SQLiteConnection (System.IO.Path.Combine (folder, "notes.db"));
db.CreateTable<Note>();

// Insert note into the database
var note = new Note { Message = "Test Note" };
db.Insert (note);

// Show the automatically set ID and message.
Console.WriteLine ("{0}: {1}", note.Id, note.Message);

Release Notes

Version 1.0.11

  • Now using the "sqlite-net-pcl" NuGet as a base
  • New: Table events
  • New: Full Text Search (FTS) support
  • New: Virtual tables
  • Several bugfixes

Version 1.0.8.2

  • Support for Xamarin.iOS 8.6
  • Added app icons and launch images

Version 1.0.8.2

  • Corrected Android sample project settings

Version 1.0.8.1

  • Support for iOS 8 and 64-bit
  • Support for Unified API

Version 1.0.8

  • Many new features
  • Many bug fixes
Write a Review

16 reviews

amber more

Is any "SQLite Json1 extension"(https://www.sqlite.org/json1.html) porting is available for this component.

Posted on: March 22, 2016 / Version: 1.0.11
Mujasam BN rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Hi,

What if i want to give the version for the sqlite databsase. How to handle the version of database during any modifications in the table and update in playstore. how I can get OnUpgrade functionality like SQLiteOpenHelper class.

Posted on: June 12, 2015 / Version: 1.0.8.3
Safdar Ali rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Is there any way to store the data in secure cipher text and make complete data encrypted.

Posted on: June 1, 2015 / Version: 1.0.8.3
Ivan Harris rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

For those who want to do bulk inserts or other bulk executions with SQLite transactions, this code might help you get started with this component.

//declare public static SQLiteConnection database;

//within method for transaction database = DependencyService.Get().GetConnection(); database.RunInTransaction(() => { //database calls inside the transaction for (var i = 0; i < 1000000; i++) { var hotel = new Hotel { name = "", number = i, }; database.Insert(hotel); } }); database.Commit();

//Above allows you to do bulk inserts. You can do whatever database calls, executions, whatever within the transaction brackets. Then, make sure to Commit it at the end to execute it.

Hope that helps someone. Took me awhile to search online and figure it out.

Posted on: February 4, 2015 / Version: 1.0.8.3
Eric Robishaw rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

No support for manually added (non ORM) Parameters on SQLiteCommand objects renders it useless for my purposes.

Posted on: October 21, 2014 / Version: 1.0.8.1
Kumar Himanshu

great its easy to implement..but how can we check our data base file in our machine...??

Posted on: June 10, 2014 / Version: 1.0.1
Ernest Scott rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Easy to use and helped get me past my SQLite needs quickly, so I could focus on other app tasks.

Posted on: May 7, 2014 / Version: 1.0.1
Mohamed Heiba rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Great component. Fast. Light. Exactly what I need in a .NET app

Posted on: April 30, 2014 / Version: 1.0.1
Arvis Liegenieks

How to get Cursor to use in CurcorAdapter from SQLiteConnection in Android???

Posted on: February 28, 2014 / Version: 1.0.1
Alexander Livingstone rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

@Ryan Shaw

SQLite-net-extensions looks great, but does it support SQLite Async?

Posted on: October 10, 2013 / Version: 1.0.1
Ryan Shaw rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Great ORM made even better with relationship extensions created by TwinCoders. The extensions add support for 1:1, 1:N, N:1, N:M and inverse relationships. They are available here: https://bitbucket.org/twincoders/sqlite-net-extensions

Posted on: September 1, 2013 / Version: 1.0.1
Vincent Bellet rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Very simple to use lib and more importantly it really give huge benefit. Though it would be neat to add a converter API in order to be able to save non suported datatype easly.

Something like this :

sqlite.AddConverter(new ConvertMyClassToString());

Posted on: August 16, 2013 / Version: 1.0.1
vahid hatefi

How difinition Foreign key for Table?

Posted on: August 8, 2013 / Version: 1.0.1
Boris S rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

It would be great if there were a native Windows/.NET implementation as well, so that one could test linked libraries prior to deploying them to the devices.

Posted on: August 1, 2013 / Version: 1.0.1
David Hayward rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

I've used the GitHub version for a long time on near 100 apps (http://SandApps.com) without any issues. I now use the component packaged one.

Solid and highly recommended.

Posted on: June 11, 2013 / Version: 1.0
Tomasz Janeczko rates this with
  • 1
  • 2
  • 3
  • 4
  • 5

Nice SQLite implementation, very simple to use. I think that it still lacks documentation on suggested stack setup (DB helpers, managing SQLiteConnections, etc.). When this will be added, I'll recommend it to anyone!

Posted on: June 11, 2013 / Version: 1.0