Skip to content

Commit

Permalink
[database] restore in memory compatability, but show it as deprecated.
Browse files Browse the repository at this point in the history
  • Loading branch information
agrosner committed Aug 27, 2017
1 parent d624e8f commit d1be504
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
@Deprecated
String databaseExtension() default "";

/**
* @deprecated use DatabaseConfig.inMemoryBuilder() instead.
*/
@Deprecated
boolean inMemory() default false;

/**
* @return If true, SQLite will throw exceptions when {@link ForeignKey} constraints are not respected.
* Default is false and will not throw exceptions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ class DatabaseDefinition(manager: ProcessorManager, element: Element) : BaseDefi

var databaseName = ""

var inMemory = false

init {
packageName = ClassNames.FLOW_MANAGER_PACKAGE

element.annotation<Database>()?.let { database ->
databaseName = database.name
databaseExtensionName = database.databaseExtension
inMemory = database.inMemory
databaseClassName = element.simpleName.toString()
consistencyChecksEnabled = database.consistencyCheckEnabled
backupEnabled = database.backupEnabled
Expand Down Expand Up @@ -196,6 +199,12 @@ class DatabaseDefinition(manager: ProcessorManager, element: Element) : BaseDefi
`return`(databaseName.S)
}
}
if (inMemory) {
`override fun`(TypeName.BOOLEAN, "isInMemory") {
modifiers(public, final)
`return`(true.L)
}
}
}
}

Expand Down

0 comments on commit d1be504

Please sign in to comment.