Skip to content

Commit

Permalink
Fix the bug for sqllin-procrssor; Update version to 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaoyuang committed Nov 7, 2023
1 parent 6fb4e83 commit bfbc5e3
Show file tree
Hide file tree
Showing 10 changed files with 65 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- Date format: YYYY-MM-dd

## v1.2.2 / 2023-xx-xx
## v1.2.2 / 2023-11-08

### All

Expand All @@ -22,6 +22,7 @@
### sqllin-processor

* Update `KSP`'s version to `1.9.20-1.0.13`
* Fix the bug for when the code that is generated by `sqllin-processor` can't be compiled([#58](https://github.com/ctripcorp/SQLlin/pull/58))

## v1.2.1 / 2023-10-18

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=1.2.1
VERSION=1.2.2
GROUP=com.ctrip.kotlin

kotlinVersion=1.9.20
Expand Down
2 changes: 1 addition & 1 deletion sqllin-dsl/doc/getting-start-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
id("com.google.devtools.ksp")
}

val sqllinVersion = "1.2.1"
val sqllinVersion = "1.2.2"

kotlin {
// ......
Expand Down
2 changes: 1 addition & 1 deletion sqllin-dsl/doc/getting-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ plugins {
id("com.google.devtools.ksp")
}

val sqllinVersion = "1.2.1"
val sqllinVersion = "1.2.2"

kotlin {
// ......
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class AndroidTest {
@Test
fun testConcurrency() = commonTest.testConcurrency()

@Test
fun testPrimitiveTypeForKSP() = commonTest.testPrimitiveTypeForKSP()

@Before
fun setUp() {
val context = InstrumentationRegistry.getInstrumentation().targetContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,26 @@ class CommonBasicTest(private val path: DatabasePath) {
Unit
}

fun testPrimitiveTypeForKSP() {
TestPrimitiveTypeForKSPTable {
SET<TestPrimitiveTypeForKSP> {
assertEquals(0, testInt)
assertEquals(0L, testLong)
assertEquals(0, testShort)
assertEquals(0, testByte)
assertEquals(0F, testFloat)
assertEquals(0.0, testDouble)
assertEquals(0U, testUInt)
assertEquals(0UL, testULong)
assertEquals(0U, testUShort)
assertEquals(0U, testUByte)
assertEquals(false, testBoolean)
assertEquals('0', testChar)
assertEquals("", testString)
}
}
}

private fun getDefaultDBConfig(): DatabaseConfiguration =
DatabaseConfiguration(
name = DATABASE_NAME,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.ctrip.sqllin.dsl

import com.ctrip.sqllin.dsl.annotation.DBRow
import kotlinx.serialization.Serializable

@DBRow
@Serializable
data class TestPrimitiveTypeForKSP(
val testInt: Int,
val testLong: Long,
val testShort: Short,
val testByte: Byte,
val testFloat: Float,
val testDouble: Double,
val testUInt: UInt,
val testULong: ULong,
val testUShort: UShort,
val testUByte: UByte,
val testBoolean: Boolean,
val testChar: Char,
val testString: String,
)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022 Ctrip.com.
* Copyright (C) 2023 Ctrip.com.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,6 +62,9 @@ class JvmTest {
@Test
fun testJoinClause() = commonTest.testJoinClause()

@Test
fun testPrimitiveTypeForKSP() = commonTest.testPrimitiveTypeForKSP()

@BeforeTest
fun setUp() {
deleteDatabase(path, CommonBasicTest.DATABASE_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ class NativeTest {
@Test
fun testConcurrency() = commonTest.testConcurrency()

@Test
fun testPrimitiveTypeForKSP() = commonTest.testPrimitiveTypeForKSP()

@BeforeTest
fun setUp() {
deleteDatabase(path, CommonBasicTest.DATABASE_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ class ClauseProcessor(
property.typeName
) {
Int::class.qualifiedName -> "0"
Long::class.qualifiedName -> "0l"
Short::class.qualifiedName -> "0s"
Byte::class.qualifiedName -> "0b"
Float::class.qualifiedName -> "0f"
Long::class.qualifiedName -> "0L"
Short::class.qualifiedName -> "0"
Byte::class.qualifiedName -> "0"
Float::class.qualifiedName -> "0F"
Double::class.qualifiedName -> "0.0"
UInt::class.qualifiedName -> "0u"
ULong::class.qualifiedName -> "0ul"
UShort::class.qualifiedName -> "0us"
UByte::class.qualifiedName -> "0ub"
UInt::class.qualifiedName -> "0U"
ULong::class.qualifiedName -> "0UL"
UShort::class.qualifiedName -> "0U"
UByte::class.qualifiedName -> "0U"
Boolean::class.qualifiedName -> "false"

Char::class.qualifiedName -> "'0'"
Expand Down

0 comments on commit bfbc5e3

Please sign in to comment.