OLZHAS
07/23/2022, 12:36 PMEvjen
07/26/2022, 10:56 AMgaryaustin
07/26/2022, 1:14 PMemin
07/29/2022, 7:46 PMMartinW
08/10/2022, 3:12 PMlet todo = Todo(label: "Example todo!")
let jsonData: Data = try JSONEncoder().encode(todo)
let jsonDict: [String: Any] = try JSONSerialization.jsonObject(with: jsonData, options: .allowFragments))
client.database.from("todos")
.insert(values: jsonDict)
.execute { results in
// Handle response
}
Giving a compile error of: Protocol 'Any' as a type cannot conform to 'Encodable'
Any help appreciated. Thanksgrsouza
08/11/2022, 9:16 AMJSONEncoder
and JSONSerialization
manually, that's already done by the library, you just need to pass an Encodable
type to the insert
method, in your example just pass the todo
directly to the insert
.
swift
let todo = Todo(label: "Example todo!")
client.database.from("todos")
.insert(values: todo)
.execute { results in
// Handle response
}
That example is incorrect, I'll be fixing it on the repositorygrsouza
08/11/2022, 9:17 AMMartinW
08/11/2022, 12:22 PMd33pu
08/26/2022, 1:54 PMmhaezaragoza
09/07/2022, 11:22 AMauth.session(from:)
, do you have any idea what's wrong?
dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "identities", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "id", intValue: nil)], debugDescription: "Attempted to decode UUID from invalid UUID string.", underlyingError: nil))
BTW, I'm updating from 0.0.4 (no error) to 0.0.9 (error).d33pu
09/11/2022, 1:53 PMcbunge3
09/26/2022, 11:43 AMgrsouza
10/19/2022, 10:00 AMd33pu
11/02/2022, 7:40 AMelliott
11/08/2022, 2:35 AMd33pu
11/08/2022, 4:58 AMcbunge3
11/09/2022, 9:07 AMd33pu
11/09/2022, 9:22 AMcbunge3
11/09/2022, 12:00 PMcbunge3
11/09/2022, 12:00 PMOLZHAS
11/09/2022, 7:01 PMOLZHAS
11/09/2022, 7:01 PMmalachi
11/11/2022, 10:38 PMmalachi
11/17/2022, 9:52 PMuploadedImage
is a UIImage and userId is just an integer. I feel like I am using the File Object incorrectly as I keep getting this error: "StorageError(statusCode: Optional(400), message: Optional("Bad Request"))".malachi
11/17/2022, 9:53 PMcbunge3
11/21/2022, 10:42 PMcbunge3
11/21/2022, 10:42 PMVik
11/26/2022, 9:31 PMJake378
12/07/2022, 5:32 PMJake378
12/07/2022, 6:10 PM