/// <summary> /// Creates a new SQLite data source /// </summary> /// <param name="connection">The SQLite connection</param> /// <param name="create_schema">Do the db schema and tables need to be created?</param> public SQLiteDataSource(SQLiteConnection connection, bool create_schema = false) { _connection = connection; _create_and_detect_schema = create_schema; _connection_string = connection.ConnectionString; // validate the connection _connection = EnsureConnection(); _geo_cache = new ConcurrentOsmDataCacheMemory(); _tags_cache = new ConcurrentTagsCollectionCache(); _id = Guid.NewGuid(); }
private SQLiteDataSource(string connection_string, OsmDataCache geo_cache, ConcurrentTagsCollectionCache tags_cache) { _connection_string = connection_string; _connection = EnsureConnection(); _tags_cache = tags_cache; _geo_cache = geo_cache; _id = Guid.NewGuid(); }
/// <summary> /// Creates a new SQLite source /// </summary> /// <param name="in_memory">Is the DB in memory? (default is false)</param> /// <param name="path">The path to the DB, or its descriptor in memory (if any)</param> /// <param name="password">The DB password (if any)</param> /// <param name="create_schema">Do the db tables need to be created?</param> public SQLiteDataSource(bool in_memory = false, string path = null, string password = null, bool create_schema = false) { // create the connection string _connection_string = SQLiteSchemaTools.BuildConnectionString(in_memory, path, password); _create_and_detect_schema = create_schema; _connection = EnsureConnection(); _geo_cache = new ConcurrentOsmDataCacheMemory(); _tags_cache = new ConcurrentTagsCollectionCache(); _id = Guid.NewGuid(); }