bitwarden-android/src/iOS.Core/Services/SqlService.cs

26 lines
772 B
C#
Raw Normal View History

2016-05-02 09:52:09 +03:00
using System;
using System.IO;
using Bit.App.Abstractions;
using Foundation;
2016-05-02 09:52:09 +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 fileManager = new NSFileManager();
var appGroupContainer = fileManager.GetContainerUrl("group.com.8bit.bitwarden");
var libraryPath = Path.Combine(appGroupContainer.Path, "Library"); // Library folder
2016-05-02 09:52:09 +03:00
var path = Path.Combine(libraryPath, sqliteFilename);
Console.WriteLine(path);
var conn = new SQLite.SQLiteConnection(path);
// Return the database connection
return conn;
}
}
}