public virtual ISQLiteConnection CreateEx(string address, string key = null, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); options.Address = address; options.Key = key; return(CreateEx(options)); }
public virtual ISQLiteConnection CreateTemp() { var options = new SQLiteConnectionOptions { Type = SQLiteConnectionOptions.DatabaseType.Temporary, }; return(CreateEx(options)); }
public virtual ISQLiteConnection CreateInMemory() { var options = new SQLiteConnectionOptions { Type = SQLiteConnectionOptions.DatabaseType.InMemory, }; return(CreateEx(options)); }
private ISQLiteConnection CreateFileDb(SQLiteConnectionOptions options) { if (string.IsNullOrWhiteSpace(options.Address)) { throw new ArgumentException(Properties.Resources.CreateFileDbInvalidAddress); } var path = options.BasePath ?? GetDefaultBasePath(); string filePath = LocalPathCombine(path, options.Address); return(CreateSQLiteConnection(filePath, options.StoreDateTimeAsTicks)); }
public virtual ISQLiteConnection CreateEx(SQLiteConnectionOptions options) { if (options == null) { throw new ArgumentNullException("options"); } switch (options.Type) { case SQLiteConnectionOptions.DatabaseType.InMemory: return(CreateInMemoryDb(options)); case SQLiteConnectionOptions.DatabaseType.Temporary: return(CreateTempDb(options)); default: return(CreateFileDb(options)); } }
private ISQLiteConnection CreateTempDb(SQLiteConnectionOptions options) { return(CreateSQLiteConnection(string.Empty, options.StoreDateTimeAsTicks)); }
private ISQLiteConnection CreateInMemoryDb(SQLiteConnectionOptions options) { return(CreateSQLiteConnection(InMemoryDatabase, options.StoreDateTimeAsTicks)); }