upgrading SQLite-net to SQLite.net - create SQLiteConnection
Asked Answered
R

1

7

I used to open my SQLiteConnection in my shared project as following:

var conn = new SQLiteConnection("MyDb.db3");

The constructor has been changed to the following signature:

    public SQLiteConnection(ISQLitePlatform sqlitePlatform, string databasePath, bool storeDateTimeAsTicks = true, IBlobSerializer serializer = null, IDictionary<string, TableMapping> tableMappings = null, IDictionary<Type, string> extraTypeMappings = null, IContractResolver resolver = null);
    public SQLiteConnection(ISQLitePlatform sqlitePlatform, string databasePath, SQLiteOpenFlags openFlags, bool storeDateTimeAsTicks = true, IBlobSerializer serializer = null, IDictionary<string, TableMapping> tableMappings = null, IDictionary<Type, string> extraTypeMappings = null, IContractResolver resolver = null);

I was not able to find any examples/documentation on how to implement this in my shared library.

Rhombohedral answered 25/5, 2015 at 6:47 Comment(0)
R
11

Quite easy once you found it. The namespace SQLite.Net.Platform containt the implementation for the ISQLitePlatforminterface.

I had to implement this in de platform specific libraries instead of the shared one.

new SQLiteConnection(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), Path.Combine(path, db));
Rhombohedral answered 25/5, 2015 at 11:39 Comment(2)
This seems outdated now. There is no SQLite.Net.Platform.Louque
@ChristoferOhlsson found a solution to this?Thresathresh

© 2022 - 2024 — McMap. All rights reserved.