Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mavenPassword=YourPassword
# here-naksha-lib-psql/src/commonMain/kotlin/naksha/psql/LibPsql.kt (adminVersion property)
# Warning: Only update LibPsql version, if there is a change in SQL functions!
# The reason is, that this version is encoded in the database, and when updated, forced an upgrade!
version=3.0.0-beta.39
version=3.0.0-beta.40

org.gradle.jvmargs=-Xmx12g
kotlin.code.style=official
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ servers:
info:
title: "Naskha Hub-API"
description: "Naksha Hub-API is a REST API to provide simple access to geo data."
version: "3.0.0-beta.39"
version: "3.0.0-beta.40"

security:
- AccessToken: [ ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class NakshaVersion(
* The current version as string to constant usage cases.
* @since 3.0
*/
const val CURRENT = "3.0.0-beta.39"
const val CURRENT = "3.0.0-beta.40"
// WARNING: Do not update this property manually, it is automatically modified when building!
// Edit version only in `gradle.properties` file, which is used as well to create artifacts!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,25 @@ data class TupleNumber(
override fun compareTo(other: TupleNumber): Int {
var i64_diff = storageNumber - other.storageNumber
if (i64_diff < 0) return -1
if (i64_diff > 1) return 1
if (i64_diff > 0) return 1
var i32_diff = mapNumber - other.mapNumber
if (i32_diff < 0) return -1
if (i32_diff > 1) return 1
if (i32_diff > 0) return 1
i32_diff = collectionNumber - other.collectionNumber
if (i32_diff < 0) return -1
if (i32_diff > 1) return 1
if (i32_diff > 0) return 1
i32_diff = partitionNumber - other.partitionNumber
if (i32_diff < 0) return -1
if (i32_diff > 1) return 1
if (i32_diff > 0) return 1
i64_diff = featureNumber - other.featureNumber
if (i64_diff < 0) return -1
if (i64_diff > 1) return 1
if (i64_diff > 0) return 1
i32_diff = version.compareTo(other.version)
if (i32_diff < 0) return -1
if (i32_diff > 1) return 1
if (i32_diff > 0) return 1
i32_diff = uid - other.uid
if (i32_diff < 0) return -1
if (i32_diff > 1) return 1
if (i32_diff > 0) return 1
return 0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ open class Version(@JvmField val txn: Int64) : Comparable<Version> {
if (s.indexOf(':') >= 0) {
val parts = s.split(':')
if (parts.size != 4) throw Exception("Too many parts")
return of(parts[0].toInt(), parts[1].toInt(), parts[0].toInt(), Int64(parts[0].toLong()))
return of(parts[0].toInt(), parts[1].toInt(), parts[2].toInt(), Int64(parts[3].toLong()))
} else {
return Version(Int64(s.toLong()))
}
Expand All @@ -95,7 +95,7 @@ open class Version(@JvmField val txn: Int64) : Comparable<Version> {
@JvmStatic
@JsStatic
fun of(year: Int, month: Int, day: Int, seq: Int64): Version =
Version((Int64(year) shl 41) or (Int64(month) shl 37) or (Int64(day) shl 32) + seq)
Version((Int64(year) shl 41) or (Int64(month) shl 37) or (Int64(day) shl 32) or seq)

/**
* Create a version from its parts.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package naksha.model

import naksha.base.Int64
import kotlin.test.Test
import kotlin.test.assertEquals

class TransactionNumberTest {
@Test
fun versionFromToString() {
val v1 = Version.of(2024, 5, 10, Int64(12345))
val s = v1.toString()
val parsed = Version.fromString(s)
assertEquals(v1.txn, parsed.txn)
}
}
Loading