sqlite-net | Fork | Database library
kandi X-RAY | sqlite-net Summary
kandi X-RAY | sqlite-net Summary
Fork of sqlite-net
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of sqlite-net
sqlite-net Key Features
sqlite-net Examples and Code Snippets
Community Discussions
Trending Discussions on sqlite-net
QUESTION
I want to build a long time not used project. After updating all possible nuget packages and try to fix the most error on my own I got the following output:
...ANSWER
Answered 2021-May-26 at 10:57Problem solved by removing all nuget packages and reinstall it manual.
QUESTION
I'm writing a simple Xamarin Forms mobile app (Android and iOS, but focusing on Android for now) as a school project. I'm using Visual Studio 2019 Community and I have installed the NuGet package sqlite-net-pcl v1.7.335
Everything was moving along when suddenly the application started throwing errors any time database access was attempted, saying "DatabasePath must be specified".
Concerned I might have made an error in my code, I created a blank application and attempted only a simple database connection. The same error occurs. Please see my code below.
MainActivity.cs
...ANSWER
Answered 2021-May-24 at 22:46you are creating MainPage
before you assign dbPath
, so when the MainPage
constructor executes dbPath
is null
QUESTION
I am trying to implement the SQLiteNetExtensions.Async nuget in a Xamarin.Forms project but when I try to create a table with some reference to SQLiteNetExtensions I get the following exception when trying to create a table (only happens in UWP , in the rest of platforms it works well): Could not load file or assembly 'SQLite-net, Version=1.4.118.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the specified file.
I use these versions:
SQLiteNetExtensions.Async version 2.1.0: https://www.nuget.org/packages/SQLiteNetExtensions.Async/
Xamarin.Forms version 5.0.0.2012
...ANSWER
Answered 2021-May-22 at 10:40I have managed to solve this problem, after downloading the source code of SQLite-Net Extensions from the original repository I have proceeded to update the target framework from the version .NET Standard 1.1 to .NET Standard 2.0 of the SQLiteNetExtensions project and SQLiteNetExtensionsAsync from the original repository and I have created a local nuget of those two projects which I have imported into my project.
I have also posted a pull request in the original repository to integrate the fix: https://bitbucket.org/twincoders/sqlite-net-extensions/pull-requests/32/fix-crash-in-uwp-for-xamarinforms
QUESTION
How do I update every row in sqlite-net-pcl database using this function by getting the id of every row even though i create new rows later on. To break it down, I need the id of every existing row in my table, and i need each one of that id to be put in this function and update the table.
...ANSWER
Answered 2021-Apr-27 at 12:44if you want to loop through every row in your table and update it, then query a list of all rows and iterate through them with foreach
QUESTION
For a table defined
...ANSWER
Answered 2021-Mar-20 at 12:03I've decided to adopt this approach for now. Credit to Jason for pointing me towards it.
Split Tbl into base class Tbl and derived class TblEx. Move the generated column property to TblEx. Hardwire TblEx to map to Sqlite table Tbl. Provide TblEx method to retrieve only properties from base class Tbl.
QUESTION
I have a database schema that I do not control (it's a sqlite3 file exported from a desktop application that I need to interoperate with), that contains UUIDs for some of the columns. I'm using sqlite-net-pcl
in a Xamarin.Forms app, and I cannot work out how to successfully read these columns. Here's what I've tried:
- using the sqlite3 command line, I've confirmed that the schema has type
uuid
for the relevant column, and usingselect count(distinct uuidcolumn) from mytable;
I've confirmed that there are values for each row. (The column is nullable which is relevant for the code snippet below but in practice all the rows have non-null values) - I have this model object:
ANSWER
Answered 2021-Mar-01 at 10:25I gave up on using the ORM features in sqlite-net-pcl
and used this query:
QUESTION
My xamarin.forms app is breaking when it hits the _connection.CreateTableAsync()
line. I tried installing the earlier version of SQLite-net-pcl nuget package but it is still breaking. If I look in the Application Output window there are these errors -
2021-02-03 14:32:20.172608-0500 Excercise.iOS[17306:776656] *** Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], UIApplication.m:4191 2021-02-03 14:32:20.198946-0500 Excercise.iOS[17306:776816] [unspecified] container_system_group_path_for_identifier: error = ((container_error_t)98) NOT_CODESIGNED 2021-02-03 14:32:20.199159-0500 Excercise.iOS[17306:776816] [MC] Error getting system group container for systemgroup.com.apple.configurationprofiles: 98 2021-02-03 14:32:20.199394-0500 Excercise.iOS[17306:776816] [MC] Failed to get profile system group container path. Overriding with expected path: /Users/xamarinforms/Library/Developer/CoreSimulator/Devices/CF07B70A-5AEC-4307-AB50-864317F14B69/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
I can't understand if this has something to do with Sqlite. Are the above errors related to bundle singing by any chance? My apple id and account that I used to signin to Visual studio are different.
My Sqlite ios implementation
...ANSWER
Answered 2021-Feb-04 at 02:13You should not have the RootViewController
code in your appdelegate:
QUESTION
I am trying to use SQLite-Net Extensions to create a Relational Database. I'm running into an issue when trying to pull the Term object from the database. It successfully pulls over its associated courses, but not the courses associated assessments and notes. I'm not sure if the problem lies in how I insert the objects into the database, how I pull the objects from the database, or how I have the objects attributes listed.
I feel like the SQLite-Net Extensions documentation is extremely limited, so I'm not even sure what's going on. I've tried it many different ways, including adding CascadeOperations, but non of those seemed to help.
Here is the (simplified) code for my objects:
...ANSWER
Answered 2021-Jan-26 at 06:05I finally figured out what was causing the crash as well as causing general confusion within SQLite-Net Extensions.
In my Assessment class, the property
QUESTION
I am using sqlite-net
in my project and have a helper class called SqLiteHelper. Inside this class I have a simple method that returns TableQuery
results as a List.
Example:
ANSWER
Answered 2021-Jan-12 at 17:02Provide the generic type constraint of T
as where T : new()
in your method. The new()
constraint lets the compiler know that any type argument supplied must have an accessible parameterless constructor.
Method:
QUESTION
I keep getting the following error when trying to initialize my SQLite-NET database:
Cannot create a table without columns (does 'PersonModel' have public properties?)
I have a class PersonModel
that I want to be immutable, however SQLite is telling me that PersonModel
must be mutable, e.g. each property must use public set;
.
How can I continue using SQLite-NET with immutable properties?
...ANSWER
Answered 2020-Nov-11 at 21:03That error is happening because SQLite-NET uses Reflection to initialize the objects it retrieves from our database, and Reflection requires public set;
to initialize each property.
We can take advantage of Init-Only Setters, new in C# 9.0.
Init-Only Setters allow us to define properties that can be set during initialization, AND cannot be changed. In other words init-only setters let us create immutable objects, AND they allow Reflection to create Immutable Objects!
I go deeper into this topic in this blog post: https://codetraveler.io/2020/11/11/using-immutable-objects-with-sqlite-net/
CodeRemove the constructor on Person
(Reflection requires a parameterless constructor), and implement init-only setters for each property:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sqlite-net
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page