Closed will closed 1 year ago
Set
actually isn't fully in Ruby 3.2, it's just autoloaded:
$ ruby -ve 'p Object.autoload?(:Set)'
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-openbsd]
"set"
So if you don't use it, you don't pay the penalty for loading it. Having Sequel handle Set would force the autoloading.
If you want this behavior, it is fairly easy to add:
class Set
def sql_literal_append(ds, sql)
ds.literal_append(sql, to_a)
end
end
Maybe I can add a Dataset extension that supports Set so that users that want this behavior can get it.
In the future, as discussed in the contribution guidelines, please use GitHub Discussions for feature requests. Only open a GitHub Issue to report a bug in Sequel.
Ah sorry! I haven't read those in a long time
@will I added a set_literalizer extension, it will be in the next release: a3e8a3f802c2f67225fdc0ccbf33f62e8419f917
Oh cool, thanks, and thanks for coming back to this issue!
Complete Description of Issue
With
Set
being fully in Ruby 3.2 without needing to require it, I think it'd be nice if you could pass sets into queries directly.I know you can cast it down to an array, which is what I do now, so it's not really that necessary of a feature.
Simplest Possible Self-Contained Example Showing the request
Full Backtrace of Exception (if any)