Skip to content

Commit 7ffacba

Browse files
committed
readme: update with latest onyx release
1 parent 21bd9a5 commit 7ffacba

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ Insert a new user instance:
7979

8080
```crystal
8181
user = User.new(name: "John")
82-
user = Onyx.query(user.insert.returning("*")).first
82+
user = Onyx::SQL.query(user.insert.returning("*")).first
8383
8484
pp user # => #<User @id=1, @name="John", @created_at=#<Time ...>>
8585
```
8686

8787
Query the user:
8888

8989
```crystal
90-
user = Onyx.query(User.where(id: 1)).first?
90+
user = Onyx::SQL.query(User.where(id: 1)).first?
9191
```
9292

9393
With another PostgreSQL table:
@@ -136,13 +136,13 @@ Create a new post:
136136
```crystal
137137
user = User.new(id: 1)
138138
post = Post.new(author: user, content: "Hello, world!")
139-
Onyx.exec(post.insert)
139+
Onyx::SQL.exec(post.insert)
140140
```
141141

142142
Query all the posts by a user with name "John":
143143

144144
```crystal
145-
posts = Onyx.query(Post
145+
posts = Onyx::SQL.query(Post
146146
.join(author: true) do |x|
147147
x.select(:id, :name)
148148
x.where(name: "John")

0 commit comments

Comments
 (0)