locked
SQLite-net Async PCL // Database Creation

    Question

  • Hello,

    i'm trying to create a Database SQLite asyn in a PCL project.

    I wrote in GITHUB ( here is the link: https://github.com/oysteinkrog/SQLite.Net-PCL/blob/master/README.mdown) what i should do.

    But i didn't know how to create "new SQLiteConnectionWithLock( *Platform*, *ConnectionString*) " , i want a portable library, not to a specified one.

    the problem is that i don't found any reference for SQL.NET.Platform in my PCL Project.

    Here is my code:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using SQLite.Net.Attributes;
    using SQLite.Net.Async;
    using SQLite.Net;
    using SQLite.Net.Interop;
    using SQLite;

    namespace PortableData
    {
        class Data
        {
            public String DefaultDBname = "HappyDataStore";
            public readonly SQLiteAsyncConnection _dbConnection;

            // Constructeur de la classe qui se charge de la creation d'une base de données SQLite
            public Data(String DBname)
            {
             
                if (DBname.Equals(null)) DBname = DefaultDBname;
              var connectionFactory = new Func<SQLiteConnectionWithLock>(()=>new SQLiteConnectionWithLock( * wht platform ?* ,new SQLiteConnectionString(DBname, true)));
                _dbConnection = new SQLiteAsyncConnection(connectionFactory);
            }

        }
    }

    Thanks for your answers and for helping me, i am blocked.

    Amine.

    Friday, March 14, 2014 2:21 PM

Answers

  • I'm not familiar with that version of the library, but reading SQLiteConnectionWithLock documentation you linked it sounds like there isn't an existing implementation of ISQLitePlatform for PCLs.

    You'd have to talk to the authors of the library to confirm.

    --Rob

    Saturday, March 15, 2014 12:52 AM
    Owner

All replies

  • I'm not familiar with that version of the library, but reading SQLiteConnectionWithLock documentation you linked it sounds like there isn't an existing implementation of ISQLitePlatform for PCLs.

    You'd have to talk to the authors of the library to confirm.

    --Rob

    Saturday, March 15, 2014 12:52 AM
    Owner
  • I know SIAQODB has an object database that works in a Portbale Class Library.  I am not sure you will find a SQLite version for a portable class library

    http://siaqodb.com/?page_id=13

    Saturday, March 15, 2014 1:59 PM