2016-05-02 09:52:09 +03:00
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using Bit.App.Abstractions;
|
|
|
|
|
|
2016-05-28 23:06:53 +03:00
|
|
|
|
namespace Bit.iOS.Core.Services
|
2016-05-02 09:52:09 +03:00
|
|
|
|
{
|
|
|
|
|
public class SqlService : ISqlService
|
|
|
|
|
{
|
|
|
|
|
public SQLite.SQLiteConnection GetConnection()
|
|
|
|
|
{
|
|
|
|
|
var sqliteFilename = "bitwarden.db3";
|
|
|
|
|
var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
|
|
|
|
|
var libraryPath = Path.Combine(documentsPath, "..", "Library"); // Library folder
|
|
|
|
|
var path = Path.Combine(libraryPath, sqliteFilename);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(path);
|
|
|
|
|
var conn = new SQLite.SQLiteConnection(path);
|
|
|
|
|
|
|
|
|
|
// Return the database connection
|
|
|
|
|
return conn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|