-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to open resource database files #77
Comments
|
So, this is possible on JVM, but native side resource management is a tricky thing. Thinking something for the DSL being // FactoryConfig.Builder
public fun resourceFilesystem(resourceDir: String, block: ResourceConfig.Builder.() -> Unit): Builder {
// TODO
// - Configure config builder
// - Set resourceConfig with returned value
// - Set filesystemConfig with returned value
// In the event filesystem is called after this, that should also clear the resourceFilesystem
//
return this
} class ResourceConfig private constructor (
) {
public class Builder internal constructor(
@JvmField
public val resourceDir: String
) {
// JVM
@JvmField
public var classLoader = Thread.currentThread().contextClassLoader
// Also need to consider Android assets
// Maybe some unique identifier producer???
// like a hash of the resourceDir path + db name that will prefix the file
// name or something.
// public fun encryption(...)
@JvmSynthetic
internal fun build(): Pair<ResourceConfig, FilesystemConfig> {
// FilesystemConfig will house the encryption and use the
// temporary directory for DatabasesDir. There are no encryption
// migrations needed for resources, so.
// Some sort of resource extractor needs to be instantiated
// here
TODO()
}
}
} |
Extraction of the resource to filesystem in the temp directory should be handled by Some things to note:
|
Providing database file via resource and opening it should be possible. JDBC already offers this, but need to play around with its functionality.
The text was updated successfully, but these errors were encountered: