onyxframework / sql

A delightful SQL ORM ☺️
https://api.onyxframework.com/sql
MIT License
91 stars 7 forks source link

Allow `select(nil)` #78

Closed vladfaust closed 5 years ago

vladfaust commented 5 years ago
posts = Onyx.query(Post
  .select(nil)
  .join(:author) do |x|
    x.select(:name)
    x.where(id: 1)
  end
)
SELECT author.name
FROM posts
JOIN users AS author ON users.id = posts.author_id
WHERE author.id = ?