Skip to content

Commit

Permalink
Merge pull request #13 from mnbjhu/fix_readme_typos
Browse files Browse the repository at this point in the history
Fixed typos
  • Loading branch information
mnbjhu committed Sep 10, 2023
2 parents c6e75c5 + c1f20d9 commit c435bac
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ db.use("ns", "db")
<b>Creating a records</b>
```kotlin
// Create a record from a JSON object
db.create("user").content(buildJsonObject( put("username", "John"), put("password", "1234")))
db.create("user").content(buildJsonObject{ put("username", "John"); put("password", "1234")})

// Create a record from a @Serializable object
@Serializable
Expand Down Expand Up @@ -99,8 +99,12 @@ db.delete("user")
<b>Querying records</b>
```kotlin
val result = db.query(
"SELECT * FROM user WHERE username = $username AND password = $password\n" +
"ORDER BY username;",
"""
SELECT *
FROM user
WHERE username = $username AND password = $password
ORDER BY username;
""",
bind("username", "John"),
bind("password", "1234")
)
Expand Down Expand Up @@ -141,8 +145,10 @@ assert(post.author.id == "user:123")

// You can fetch a record from a reference
val queryResult = query(
"SELECT * FROM post WHERE author = $author\n" +
"FETCH author LIMIT 1;",
"""
SELECT * FROM post WHERE author = $author
FETCH author LIMIT 1;
""",
bind("author", "John")
)
val post = queryResult.first().data<List<Post>>()[0]
Expand Down

0 comments on commit c435bac

Please sign in to comment.