Skip to content

Add ability to configure SQLiteDatabaseConfiguration for support interfaces#58

Merged
npurushe merged 2 commits intorequery:masterfrom
MisterRager:misterrager/add-requery-configs-to-support-interfaces
Jan 31, 2018
Merged

Add ability to configure SQLiteDatabaseConfiguration for support interfaces#58
npurushe merged 2 commits intorequery:masterfrom
MisterRager:misterrager/add-requery-configs-to-support-interfaces

Conversation

@MisterRager
Copy link
Contributor

The support interfaces are helpful, but there's no way to configure the db created to use custom extensions and functions. This allows users to inject their own configurations.

@dhleong
Copy link
Contributor

dhleong commented Jan 21, 2018

There is, actually. See this class.

There's a public ArrayList you can add SQLiteCustomFunction and SQLiteCustomExtension instances to.

@MisterRager
Copy link
Contributor Author

The only way to feed a custom version of that class into your db connection is by overriding the default behavior of SQLiteOpenHelper#createConfiguration. This method is not overridden in RequerySQLiteOpenHelperFactory.CallbackSQLiteOpenHelper, leaving no way to actually provide an instance of the specified class. As you can see in the code, the requested changes do this using the class you mention.

@dhleong
Copy link
Contributor

dhleong commented Jan 23, 2018

Ah... right, my mistake. Should've looked closer, sorry!

@MisterRager
Copy link
Contributor Author

I'm not sure what Travis' complaint is - I've run the tests against an emulator on my own laptop, tho.

}
}

public interface RequeryConfigurationOption {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This inner class can just be named ConfigurationOption I don't think the requery prefix adds much since it's already in a class prefixed with that.

public interface RequeryConfigurationOption {
SQLiteDatabaseConfiguration apply(SQLiteDatabaseConfiguration configuration);
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line ending

@npurushe
Copy link
Contributor

npurushe commented Jan 24, 2018

I think these changes look ok, just some minor comments. I have re-triggered the build too. Thanks

@npurushe npurushe merged commit 8ee97e8 into requery:master Jan 31, 2018
@npurushe
Copy link
Contributor

Thanks!

@MisterRager
Copy link
Contributor Author

Thanks for taking the code!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants