clean Requester

This commit is contained in:
2021-07-14 23:30:29 +02:00
parent 486b038ad2
commit 682fd5caba
9 changed files with 67 additions and 99 deletions

View File

@@ -5,7 +5,7 @@ import java.nio.file.Path
class Function(
override val script: String,
override var source: Path? = null
override val source: Path? = null
) : Resource, ParametersInterface {
val returns: String
override val name: String

View File

@@ -4,14 +4,12 @@ import java.nio.file.Path
class Migration(
override val script: String,
source: Path
override var source: Path
) : Resource {
override val name: String
val direction: Direction
override var source: Path? = null
init {
this.source = source
this.direction = source.fileName.toString()
.let {
when {

View File

@@ -4,9 +4,8 @@ import java.nio.file.Path
class Query(
override val script: String,
source: Path
override var source: Path
) : Resource {
override var source: Path? = source
override val name: String = getNameFromComment(script) ?: getNameFromFile(source)
/** Try to get name from comment in file */

View File

@@ -7,7 +7,7 @@ import java.nio.file.Path
sealed interface Resource {
val name: String
val script: String
var source: Path?
val source: Path?
open class ParseException(message: String, cause: Throwable? = null) : Exception(message, cause)