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 11package io.github.jan.supabase.ksp
22
3+ // Used for auto-casting, when no type is specified
34val primitiveColumnTypes = mapOf<String , String >(
45 " kotlin.String" to " text" ,
56 " kotlin.Int" to " int4" ,
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments