On Wed, Dec 2, 2020 at 8:42 PM J. Lewis Muir <[email protected]> wrote:
> On Wednesday, December 2, 2020 at 2:36:09 PM UTC-6 Jeremy Evans wrote: > >> Unfortunately, there is no way for Sequel to fix this. When using the >> mysql2 driver, it handles the timezone conversion and Sequel never sees the >> original string sent by the database server, so it cannot handle the >> conversion correctly. >> > > Bummer. > > >> I can fix the warning in Sequel, but unfortunately, that's all I can do. >> If you want mysql2 to support named timezones for :database_timezone, >> you'll have to file an issue with them or send them a pull request ( >> https://github.com/brianmario/mysql2/issues). >> > > OK, created: > > https://github.com/brianmario/mysql2/issues/1148 > > Starting in Ruby 2.6 it should be possible for mysql2 to use Ruby's >> timezone support to implement the named timezone support. >> > > OK, or what about another mode (e.g., :passthrough) that would make > Mysql2 get out of the way and let it be handled in Sequel? > Not sure how that would be possible. If you can think of a way and submit a pull request, I'll consider it. > One of my deployment targets is RHEL 7, and Ruby is at 2.0 there, so it > would be great if that could still be used and not require 2.6. > If you can use Ruby 2.0, you should be able to easily use the mysql gem. Current Sequel runs fine on Ruby 2.0. You will have to switch to Sequel.datetime_class = DateTime, though, because timezone support was not added to Time until Ruby 2.6. > > Note that you can use the mysql adapter and it handles the conversion >> correctly, since Sequel handles the type conversion in that case instead of >> the driver. However, you'll have to patch the mysql gem to run on Ruby >> 2.4+. Here's an example of such a patch: >> https://raw.githubusercontent.com/openbsd/ports/master/databases/ruby-mysql/patches/patch-ext_mysql_api_mysql_c >> > > Thanks for that! I would be perfectly happy to switch to the mysql > adapter if the mysql gem were maintained, but sadly it appears to be > looking for a maintainer and not accepting any code changes based on the > README.md message and last commit timestamp at > > https://github.com/luislavena/mysql-gem > > and issue #33 > > https://github.com/luislavena/mysql-gem/issues/33 > > Having to patch it is a real pain since I wouldn't be able to get it via > RubyGems.org. :-( > Agreed, it's a pain. It's also slower and I think queries with it still block the whole VM until they finish executing. Hopefully mysql2 is receptive to adding support. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/CADGZSScD3yaiJvvf55Nskv89sTmMmgcaXs6STJhO5Ko6fg6F4Q%40mail.gmail.com.
