File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
KSP/src/main/kotlin/io/github/jan/supabase/ksp Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 1
1
package io.github.jan.supabase.ksp
2
2
3
+ // Used for auto-casting, when no type is specified
3
4
val primitiveColumnTypes = mapOf<String , String >(
4
5
" kotlin.String" to " text" ,
5
6
" kotlin.Int" to " int4" ,
Original file line number Diff line number Diff line change @@ -39,11 +39,7 @@ class SelectableSymbolProcessor(
39
39
val types = hashMapOf<String , String >()
40
40
symbols.forEach { symbol ->
41
41
val className = symbol.simpleName.asString()
42
- val qualifiedName = symbol.qualifiedName?.asString()
43
- if (qualifiedName == null ) {
44
- logger.error(" Qualified name of $className is null" , symbol)
45
- return @forEach;
46
- }
42
+ val qualifiedName = symbol.simpleName.asString() // Kotlin JS doesn't support qualified names
47
43
if (! symbol.modifiers.contains(Modifier .DATA )) {
48
44
logger.error(" The class $className is not a data class" , symbol)
49
45
return emptyList()
@@ -76,12 +72,13 @@ class SelectableSymbolProcessor(
76
72
.addFunction(function.build())
77
73
.addImport(" io.github.jan.supabase.postgrest.annotations" , " Selectable" )
78
74
.build()
79
- codeGenerator.createNewFile(
75
+ val stream = codeGenerator.createNewFile(
80
76
Dependencies (false , * sources.toTypedArray()),
81
77
packageName,
82
78
fileName,
83
79
extensionName = " kt"
84
- ).bufferedWriter().use {
80
+ )
81
+ stream.bufferedWriter().use {
85
82
fileSpec.writeTo(it)
86
83
}
87
84
}
You can’t perform that action at this time.
0 commit comments