Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
fhennig committed Jan 23, 2025
1 parent b6997b9 commit fb9eff5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ object CurrentProcessingPipelineTable : Table(CURRENT_PROCESSING_PIPELINE_TABLE_
val organismColumn = varchar("organism", 255)
val startedUsingAtColumn = datetime("started_using_at")

fun pipelineNeedsUpdate(foundVersion: Long, organism: String) =
CurrentProcessingPipelineTable
.selectAll()
.where { CurrentProcessingPipelineTable.versionColumn neq foundVersion }
.andWhere { CurrentProcessingPipelineTable.organismColumn eq organism }
.limit(1)
.empty()
.not()
fun pipelineNeedsUpdate(foundVersion: Long, organism: String) = CurrentProcessingPipelineTable
.selectAll()
.where { CurrentProcessingPipelineTable.versionColumn neq foundVersion }
.andWhere { CurrentProcessingPipelineTable.organismColumn eq organism }
.limit(1)
.empty()
.not()
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ object SequenceEntriesTable : Table(SEQUENCE_ENTRIES_TABLE_NAME) {
)
}

fun distinctOrganisms() =
SequenceEntriesTable
.select(SequenceEntriesTable.organismColumn)
.withDistinct()
.asSequence()
.map {
it[SequenceEntriesTable.organismColumn]
}
fun distinctOrganisms() = SequenceEntriesTable
.select(SequenceEntriesTable.organismColumn)
.withDistinct()
.asSequence()
.map {
it[SequenceEntriesTable.organismColumn]
}

fun accessionVersionIsIn(accessionVersions: List<AccessionVersionInterface>) =
Pair(accessionColumn, versionColumn) inList accessionVersions.toPairs()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import org.jetbrains.exposed.sql.Op
import org.jetbrains.exposed.sql.SortOrder
import org.jetbrains.exposed.sql.SqlExpressionBuilder.less
import org.jetbrains.exposed.sql.SqlExpressionBuilder.plus
import org.jetbrains.exposed.sql.StringColumnType
import org.jetbrains.exposed.sql.Transaction
import org.jetbrains.exposed.sql.VarCharColumnType
import org.jetbrains.exposed.sql.alias
Expand Down Expand Up @@ -1224,9 +1223,9 @@ private fun Transaction.findNewPreprocessingPipelineVersion(organism: String): L
Pair(VarCharColumnType(), organism),
Pair(VarCharColumnType(), organism),
Pair(VarCharColumnType(), organism),
Pair(VarCharColumnType(), organism)
Pair(VarCharColumnType(), organism),
),
explicitStatementType = StatementType.SELECT
explicitStatementType = StatementType.SELECT,
) { resultSet ->
if (!resultSet.next()) {
return@exec null
Expand Down

0 comments on commit fb9eff5

Please sign in to comment.