sqlite-net is an open source, minimal library to allow .NET and Mono applications to store data in SQLite databases.
Questions tagged [sqlite.net]
100 questions
13
votes
1 answer
How can you store lists of objects in SQLite.net?
Let us assume I have these two objects
class Customer {
[PrimaryKey]
public string id;
[??????]
public List addresses;
}
and
class Address {
[PrimaryKey, AutoIncrement]
public int id;
public string street;
…

Cruces
- 3,029
- 1
- 26
- 55
13
votes
6 answers
How to use InsertOrReplace in sqlite.net PCL?
I am using the PCL version of sqlite.net from here (https://github.com/oysteinkrog/SQLite.Net-PCL).
Here is my simple class.
public class LogEntry
{
[PrimaryKey, AutoIncrement]
public int Key { get; set;}
public DateTime…

dakamojo
- 1,839
- 5
- 21
- 35
12
votes
2 answers
How to set default value for Sqlite.net without using sqlite raw statement/conn.execute()
I know it's a stupid question, but I could not find the answer anywhere.
How to set a default value for a column in sqlite.net model?
Here is my model class:
public class ItemTaxes
{
[PrimaryKey]
public string Sku { get; set;}
public…

macio.Jun
- 9,647
- 1
- 45
- 41
9
votes
2 answers
How do you run a batch of SQL statements using the SQLite.NET PCL
In the past I have avoided ORM and always handcrafted parameterised queries etc. This is very time consuming and a real pain when first developing an application. Recently I decided to have another look at ORM specifically the Sqlite.NET ORM.
I…

Alan
- 115
- 1
- 5
8
votes
3 answers
SQLite.NET - System.NotSupportedException: Cannot compile: Parameter
I am using SQLite.NET Async (http://www.nuget.org/packages/SQLite.Net.Async-PCL/) in a Xamarin iOS project, but I am having a problem using the table predicate queries.
Anytime I use the Get method below, which is very simple, I receive an…

Zach Green
- 3,421
- 4
- 29
- 32
7
votes
2 answers
How to return Wrapper obj of TableOjb1 and TableObj2 using linq
class TableObj1 {
public string Id {get; set;}
public string Name {get; set;}
}
class TableObj2 {
public string Id {get; set;}
public string Email {get; set;}
}
class MergeObj {
public TableObj1 Obj1 {get; set;}
public…

macio.Jun
- 9,647
- 1
- 45
- 41
6
votes
3 answers
Upgrade database with Sqlite.net Pcl for Xamarin android
i have the problem that when i release new version of my application, if i add a new column to one of my db tables, the database doesn't update. Any one know how to create a script of upgrade versione in case there are new columns or new…

white.devils
- 131
- 1
- 10
5
votes
1 answer
When is the Index attribute used on a Sqlite.Net class?
I am building a mobile application using Sqlite.Net and I have come across the Indexed attribute. This is shown in the example here: https://github.com/praeclarum/sqlite-net#example-time
public class Stock
{
[PrimaryKey, AutoIncrement]
…

JKennedy
- 18,150
- 17
- 114
- 198
5
votes
0 answers
SQLite.Net-PCL terrible performance (InsertOrReplace)
foreach (var tour in Tours)
{
await DbInstance.InsertOrReplaceAsync(tour.Guide);
await DbInstance.InsertOrReplaceAsync(tour.Client);
}
This block takes 6 seconds to execute !?
I have only 10…

Millkovac
- 101
- 6
5
votes
1 answer
Is it possible to use SQLite.NET with immutable record types?
The title says it. (to be clear, SQLite.NET is hosted here)
All the examples work with mutable record types, that means they have { get; set; } in each property definition. I want to get rid of mutable types where possible in my project, but…

Display Name
- 8,022
- 3
- 31
- 66
5
votes
2 answers
sqlite.net + monotouch = SIGSEGV crashes
We're using the following:
Xamarin 3 (Xamarin Forms)
MonoTouch
sqlite.net
iOS simulator/hardware
The app synchronizes data with a server on a background thread. There is only one SQLite connection object shared by the entire app. Foreground…

Steve Macdonald
- 1,745
- 2
- 20
- 34
4
votes
3 answers
InsertAll & UpdateAll in sqlite-net-pcl VS InsertOrReplaceAll in SQLite.Net-PCL
I want to remove SQLite.Net-PCL package and want to use sqlite-net-pcl because I later found that SQLite.Net-PCL is not officially being maintained.
I have tables which stores GUID as primary key of string type in my Xamarin project. I have List of…

MilanG
- 2,551
- 16
- 24
4
votes
5 answers
Is it possible to return dynamic objects or Dataset from a Sqlite Query?
I am using Sqlite.Net in my Xamarin.Forms application. So far it has been great at returning lists of objects if my object is a class like so:
SqliteDatabase.Connection.Query("Select * from Customers");
I would now like to return the…

JKennedy
- 18,150
- 17
- 114
- 198
4
votes
1 answer
Xamarin SQLite.NET Generic TableQuery
I use the component "SQLite.NET" in my Xamarin-project.
I have several "models/classes" like "Document","Project".
Each model has its own Table in SQLite.
To get the data from a table, i'm using the following technique:
List documents =…

Benjamin Ceustermans
- 43
- 1
- 3
4
votes
1 answer
sqlite.net table where condition on a child table
I'm using Xamarin forms, SQLite.net and SQLitenet extensions and I'm unable to figure out why something that I would expect to be simple just doesn't work.
I have two classes
public class MeasurementInstanceModel
{
public…

user1428857
- 73
- 1
- 2
- 5