On Thursday, August 10, 2017 at 8:10:10 AM UTC-7, Jeff Koenig wrote:
>
> I recently had to migrate from sqlite to postgres and after attempting to 
> use many different tools that all failed, I found sequel and it just 
> worked!  However, after I did some comparisons on the data, I found that 
> sequel converted the sqlite epoch timestamps to the local timezone, but 
> then stored it in postgres without a timezone, which makes it difficult to 
> fix.
>
> I ended up working around this by forcing the record to utc before it gets 
> inserted into the new database.  I know this isn't the right way to handle 
> this, but I was unable to find documentation on how to specify timezone 
> settings when using the Copy feature of the sequel executable.
>
> I think three things should be considered here..
>
> 1. Adding timezone arguments to the sequel executable, or use environment 
> variables to make settings for Sequel.application_timezone, 
> Sequel.database_timezone,  and Sequel.default_timezone
> 2. Add documentation to `bin_sequel.rdoc` 
> 3. In the case that you are coming from epoch time, UTC should be used, 
> since that is how epoch time is stored.
>
> I very much recognize that I don't know this project well, so I may very 
> well have missed something and sorry if this is way off base, but if 
> nothing else, I think this could point to a need for some specific 
> documentation.
>

The  bin/sequel -C feature is bare bones and mostly serves as a quick and 
dirty way to convert databases.  It is not designed to handle all use 
cases.  For anything where it doesn't do what you want, you should use the 
Sequel API directly.  To start, you can copy the code out of the bin/sequel 
file to a separate file, and modify it as appropriate for your use case.

I do think the documentation should probably make this clear, I'll try to 
update it before the next release.

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 sequel-talk+unsubscr...@googlegroups.com.
To post to this group, send email to sequel-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to