Repository: supabase-community/supabase-kt (kotlin)

Issue:
[Bug]: gt() crash in version 3.2.5 when used in KMP
### General Info

- [x] I checked for similar bug report
- [x] I am using the latest version
- [x] I checked the [troubleshooting](https://github.com/supabase-community/supabase-kt/blob/master/TROUBLESHOOTING.md) page for similar problems

### Version(s)

3.2.5

### Kotlin Target(s) and their respective versions

KMP

### What happened? (include your code)

I just updated to version 3.2.5 and I had to go back to 3.2.5 because I'm getting this error ```io.github.jan.supabase.postgrest.exception.PostgrestRestException: invalid input syntax for type numeric: ""0.0""``` with gt() when I have it like this: ```gt("cantidad_disponible", 0.0)```

I don't know why this happens. Besides, I don't see anything new in the documentation, and it still works.

Thanks, and best regards.

### Steps To Reproduce (optional)

_No response_

### Relevant log output (optional)

```shell

```

Pull request:
## What kind of change does this PR introduce?

Bug fix (closes #1083)

## What is the current behavior?

Numbers are getting quoted/escaped since they contain a `.`. Also: missing escape quotes in the `filterNot` method

## What is the new behavior?

Numbers are no longer quoted and `filterNot` values are getting escaped

## Additional context

Add any other context or screenshots.

Patch:
diff --git a/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/FilterOperation.kt b/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/FilterOperation.kt
index 8f996f8a..cd5e9d79 100644
--- a/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/FilterOperation.kt
+++ b/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/FilterOperation.kt
@@ -77,7 +77,7 @@ internal fun escapeValue(value: Any?): String {
     val asString = value.toString()
         .replace("\\", "\\\\")
         .replace("\"", "\\\"")
-    return if (quotedCharacters.any { asString.contains(it) }) {
+    return if (value !is Number && quotedCharacters.any { asString.contains(it) }) {
         "\"$asString\""
     } else {
         asString
diff --git a/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/PostgrestFilterBuilder.kt b/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/PostgrestFilterBuilder.kt
index 6524ce10..57d7e095 100644
--- a/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/PostgrestFilterBuilder.kt
+++ b/Postgrest/src/commonMain/kotlin/io/github/jan/supabase/postgrest/query/filter/PostgrestFilterBuilder.kt
@@ -21,15 +21,15 @@ class PostgrestFilterBuilder(
     /**
      * Adds a negated filter to the query
      */
-    fun filterNot(column: String, operator: FilterOperator, value: Any?) {
-        val columnValue = params[column] ?: emptyList()
-        _params[column] = columnValue + listOf("not.${operator.identifier}.$value")
-    }
+    fun filterNot(column: String, operator: FilterOperator, value: Any?) = filterNot(FilterOperation(column, operator, value))
 
     /**
      * Adds a negated filter to the query
      */
-    fun filterNot(operation: FilterOperation) = filterNot(operation.column, operation.operator, operation.value)
+    fun filterNot(operation: FilterOperation) {
+        val columnValue = params[operation.column] ?: emptyList()
+        _params[operation.column] = columnValue + listOf("not.${operation.operator.identifier}.${operation.escapedValue()}")
+    }
 
     /**
      * Adds a filter to the query


Test patch:
diff --git a/Postgrest/src/commonTest/kotlin/PostgrestFilterBuilderTest.kt b/Postgrest/src/commonTest/kotlin/PostgrestFilterBuilderTest.kt
index 7ba24446..18247e60 100644
--- a/Postgrest/src/commonTest/kotlin/PostgrestFilterBuilderTest.kt
+++ b/Postgrest/src/commonTest/kotlin/PostgrestFilterBuilderTest.kt
@@ -17,6 +17,14 @@ data class TestData(@SerialName("created_at") val createdAt: Instant)
 
 class PostgrestFilterBuilderTest {
 
+    @Test
+    fun filterFloat() {
+        val filter = filterToString {
+            eq("id", 1.0)
+        }
+        assertEquals("id=eq.1.0", filter)
+    }
+
     @Test
     fun eq() {
         val filter = filterToString {