Skip to content

Commit bd4f31b

Browse files
committed
Fix error when not using the root package
1 parent 9df7b82 commit bd4f31b

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

KSP/src/main/kotlin/io/github/jan/supabase/ksp/PrimitiveColumnType.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.github.jan.supabase.ksp
22

3+
//Used for auto-casting, when no type is specified
34
val primitiveColumnTypes = mapOf<String, String>(
45
"kotlin.String" to "text",
56
"kotlin.Int" to "int4",

KSP/src/main/kotlin/io/github/jan/supabase/ksp/SelectableSymbolProcessor.kt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ class SelectableSymbolProcessor(
3939
val types = hashMapOf<String, String>()
4040
symbols.forEach { symbol ->
4141
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
4743
if (!symbol.modifiers.contains(Modifier.DATA)) {
4844
logger.error("The class $className is not a data class", symbol)
4945
return emptyList()
@@ -76,12 +72,13 @@ class SelectableSymbolProcessor(
7672
.addFunction(function.build())
7773
.addImport("io.github.jan.supabase.postgrest.annotations", "Selectable")
7874
.build()
79-
codeGenerator.createNewFile(
75+
val stream = codeGenerator.createNewFile(
8076
Dependencies(false, *sources.toTypedArray()),
8177
packageName,
8278
fileName,
8379
extensionName = "kt"
84-
).bufferedWriter().use {
80+
)
81+
stream.bufferedWriter().use {
8582
fileSpec.writeTo(it)
8683
}
8784
}

0 commit comments

Comments
 (0)