Skip to content

Commit e4b5e81

Browse files
authored
Fixed CRUD implementation example in ReadMe (#71)
1 parent 652d2db commit e4b5e81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ First, import and initialize `SupabaseClient`, as explained in "Usage" section.
200200
- Create a model which follows your table's data structure:
201201

202202
```swift
203-
struct InsertModel: Encodable {
203+
struct InsertModel: Encodable, Decodable {
204204
let id: Int? // you can choose to omit this depending on how you've setup your table
205205
let title: String?
206206
let desc: String?
@@ -216,7 +216,7 @@ let query = client.database
216216

217217
Task {
218218
do {
219-
let response: InsertModel = try await query.execute().value
219+
let response: [InsertModel] = try await query.execute().value
220220
print("### Returned: \(response)")
221221
} catch {
222222
print("### Insert Error: \(error)")
@@ -238,7 +238,7 @@ let query = client.database
238238

239239
Task {
240240
do {
241-
let response: InsertModel = try await query.execute().value
241+
let response: [InsertModel] = try await query.execute().value
242242
print("### Returned: \(response)")
243243
} catch {
244244
print("### Insert Error: \(error)")

0 commit comments

Comments
 (0)