1
0
mirror of https://github.com/bitwarden/mobile.git synced 2025-01-09 19:17:42 +01:00
bitwarden-mobile/src/Android/Services/SqlService.cs

30 lines
865 B
C#
Raw Normal View History

2016-05-02 08:52:09 +02:00
using System;
using System.IO;
using Bit.App.Abstractions;
using SQLite;
2016-05-02 08:52:09 +02:00
namespace Bit.Android.Services
{
public class SqlService : ISqlService
{
private SQLiteConnection _connection;
public SQLiteConnection GetConnection()
2016-05-02 08:52:09 +02:00
{
if(_connection != null)
{
return _connection;
}
2016-05-02 08:52:09 +02:00
var sqliteFilename = "bitwarden.db3";
var documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Documents folder
var path = Path.Combine(documentsPath, sqliteFilename);
Console.WriteLine(path);
_connection = new SQLiteConnection(path,
SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create | SQLiteOpenFlags.FullMutex | SQLiteOpenFlags.SharedCache);
return _connection;
2016-05-02 08:52:09 +02:00
}
}
}