Hi,
I'm writing a ETL/reporting script at the moment, and I'm using Sequel
because it's great.
One of the early steps of the reporting, though, involves loading a
gzipped database dump (made from our production server using
`mysqldump`).
I know that `Database#run` can handle being passed multiple queries, so
my first resort was to try:
Zlib::GzipReader.open("dump.sql.gz") do |dump|
DB << dump.read
end
But Sequel doesn't seem to like the stream-style comments that
`mysqldump` puts at the top of the file — stuff like:
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
Before I write a regex to strip them out, and potentially go down a
rabbit hole of further problems, I was wondering: am I going about this
the right way? Is there a way to read an SQL dump in Sequel that handles
these comments okay, or am I abusing Sequel in even trying?
Many thanks,
Rob Miller
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.