Skip to content

Commit 5cc9cde

Browse files
committed
Improve docs
1 parent 8403274 commit 5cc9cde

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/annotations/Cast.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import io.github.jan.supabase.annotations.SupabaseInternal
44

55
/**
66
* Annotation to cast a column in a PostgREST query.
7-
* @param type The type to cast the column to. If empty, the type will be inferred from the parameter type. For example, if the parameter is of type `String`, the column will be cast to `text`.
7+
* @param type The type to cast the column to. If empty, the type will be inferred from the parameter type. For example, if the parameter is of type [String], the column will be cast to `text`. For all supported auto-casts see the primitive types in [Selectable].
88
*/
99
@Target(AnnotationTarget.VALUE_PARAMETER)
1010
@Retention(AnnotationRetention.SOURCE)

Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/annotations/JsonPath.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ annotation class JsonPath(vararg val path: String, val returnAsText: Boolean = f
3838

3939
companion object {
4040
@SupabaseInternal const val PATH_PARAMETER_NAME = "path"
41-
@SupabaseInternal const val KEY_PARAMETER_NAME = "key"
4241
@SupabaseInternal const val RETURN_AS_TEXT_PARAMETER_NAME = "returnAsText"
4342
}
4443

Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/annotations/Selectable.kt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ package io.github.jan.supabase.postgrest.annotations
22

33
import io.github.jan.supabase.annotations.SupabaseExperimental
44
import io.github.jan.supabase.postgrest.query.PostgrestQueryBuilder
5+
import kotlinx.datetime.Instant
6+
import kotlinx.datetime.LocalDate
7+
import kotlinx.datetime.LocalDateTime
8+
import kotlinx.datetime.LocalTime
9+
import kotlinx.serialization.json.JsonArray
10+
import kotlinx.serialization.json.JsonElement
11+
import kotlinx.serialization.json.JsonObject
12+
import kotlinx.serialization.json.JsonPrimitive
13+
import kotlin.uuid.Uuid
514

615
/**
716
* Annotates a class as selectable.
@@ -15,7 +24,7 @@ import io.github.jan.supabase.postgrest.query.PostgrestQueryBuilder
1524
* - All parameters in the primary constructor must a primitive type¹, a type that is also annotated with [Selectable] or a serializable type.
1625
* - Parameters may be annotated with [ColumnName], [ApplyFunction], [Cast], [JsonPath], [Foreign].
1726
*
18-
* ¹: Available primitive types are: String, Int, Long, Float, Double, Boolean, Byte, Short, Char, Instant, LocalDateTime, Uuid, LocalTime, LocalDate, JsonElement, JsonObject, JsonArray, JsonPrimitive
27+
* ¹: Available primitive types are: [String], [Int], [Long], [Float], [Double], [Boolean], [Byte], [Short], [Char], [Instant], [LocalDateTime], [Uuid], [LocalTime], [LocalDate], [JsonElement], [JsonObject], [JsonArray], [JsonPrimitive]
1928
*
2029
* Example usage:
2130
* ```kotlin
@@ -42,4 +51,4 @@ import io.github.jan.supabase.postgrest.query.PostgrestQueryBuilder
4251
@Target(AnnotationTarget.CLASS)
4352
@Retention(AnnotationRetention.SOURCE)
4453
@SupabaseExperimental
45-
annotation class Selectable
54+
annotation class Selectable

0 commit comments

Comments
 (0)