Skip to content

feat: support kotlin uuid#79

Draft
driessamyn wants to merge 1 commit into
mainfrom
kotlin-uuid-support
Draft

feat: support kotlin uuid#79
driessamyn wants to merge 1 commit into
mainfrom
kotlin-uuid-support

Conversation

@driessamyn
Copy link
Copy Markdown
Owner

@driessamyn driessamyn commented Feb 9, 2025

Investigating impact of supportin #76

Not sure yet about inclusion of Experimental API.

@driessamyn driessamyn marked this pull request as ready for review February 9, 2025 21:33
@qodo-free-for-open-source-projects
Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Organization
best practice
Add documentation to explain experimental feature usage and provide clear usage examples

The class uses the experimental Kotlin UUID API
(@OptIn(ExperimentalUuidApi::class)) but lacks documentation explaining this
experimental feature usage and potential implications. Add KDoc comments
explaining the experimental UUID support, its benefits, and any considerations
users should be aware of.

core/src/main/kotlin/net/samyn/kapper/internal/AutoConverter.kt [13-25]

+/**
+ * Handles automatic type conversion between different data types.
+ *
+ * This converter supports the experimental Kotlin UUID API in addition to Java UUID.
+ * The Kotlin UUID implementation is currently experimental and may change in future releases.
+ *
+ * Example usage with Kotlin UUID:
+ * ```
+ * val kotlinUuid = Uuid.parse("123e4567-e89b-12d3-a456-426614174000")
+ * val javaUuid = autoConverter.convert(kotlinUuid, UUID::class)
+ * ```
+ */
 @OptIn(ExperimentalUuidApi::class)
 constructor(
-    // register converters
-    //   we can/should extend this to allow users to register custom converters.
     private val converters: Map<KClass<*>, (Any) -> Any> =
         mapOf(
             UUID::class to ::convertUUID,
             kotlin.uuid.Uuid::class to ::convertUUID,
             LocalDate::class to ::convertLocalDate,
             ...
         ),
 )

[To ensure code accuracy, apply this suggestion manually]

Low

@driessamyn driessamyn marked this pull request as draft February 9, 2025 21:34
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Feb 9, 2025

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 9, 2025

Test Results

 32 files  ±0   32 suites  ±0   31s ⏱️ +9s
213 tests +4  213 ✅ +4  0 💤 ±0  0 ❌ ±0 
271 runs  +4  271 ✅ +4  0 💤 ±0  0 ❌ ±0 

Results for commit e79f57e. ± Comparison against base commit 1998123.

This pull request removes 38 and adds 41 tests. Note that renamed tests count towards both.

net.samyn.kapper.QueryParserTest ‑ [5] 
net.samyn.kapper.SQLTypesConverterTest ‑ [10] LONGNVARCHAR, LONGNVARCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$639/0x00007effdc421320@a8836b2
net.samyn.kapper.SQLTypesConverterTest ‑ [11] INSTANT, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$806/0x00007effdc4eea70@1bd30796
net.samyn.kapper.SQLTypesConverterTest ‑ [11] LONGVARCHAR, LONGVARCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$640/0x00007effdc421548@45b00576
net.samyn.kapper.SQLTypesConverterTest ‑ [12] DATE, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$807/0x00007effdc4eec98@398b1113
net.samyn.kapper.SQLTypesConverterTest ‑ [12] NCHAR, NCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$641/0x00007effdc421770@186620e0
net.samyn.kapper.SQLTypesConverterTest ‑ [13] NCLOB, NCLOB, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$642/0x00007effdc421998@59850761
net.samyn.kapper.SQLTypesConverterTest ‑ [14] NVARCHAR, NVARCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$643/0x00007effdc421bc0@2607416f
net.samyn.kapper.SQLTypesConverterTest ‑ [15] ROWID, ROWID, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$644/0x00007effdc421de8@120780f3
…
net.samyn.kapper.AutoConverterTest$DefaultConverters ‑ supports kotlin UUID()
net.samyn.kapper.ConverterTest$UUIDConverter ‑ when kotlin UUID convert()
net.samyn.kapper.QueryParserTest ‑ [5] 

net.samyn.kapper.SQLTypesConverterTest ‑ [10] LONGNVARCHAR, LONGNVARCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$654/0x00007f7a2c43d5c8@266ddc79
net.samyn.kapper.SQLTypesConverterTest ‑ [11] INSTANT, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$833/0x00007f7a2c4efd88@763f1ff7
net.samyn.kapper.SQLTypesConverterTest ‑ [11] LONGVARCHAR, LONGVARCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$655/0x00007f7a2c43d7f0@230d0f80
net.samyn.kapper.SQLTypesConverterTest ‑ [12] DATE, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$834/0x00007f7a2c4ebb40@addce01
net.samyn.kapper.SQLTypesConverterTest ‑ [12] NCHAR, NCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$656/0x00007f7a2c43da18@36923bf0
net.samyn.kapper.SQLTypesConverterTest ‑ [13] NCLOB, NCLOB, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$657/0x00007f7a2c43dc40@70753c47
net.samyn.kapper.SQLTypesConverterTest ‑ [14] NVARCHAR, NVARCHAR, net.samyn.kapper.SQLTypesConverterTest$Companion$$Lambda$658/0x00007f7a2c43de68@ce261a2
…

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant