Skip to content

Instantly share code, notes, and snippets.

@metaperl
Created August 18, 2009 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save metaperl/169866 to your computer and use it in GitHub Desktop.
Save metaperl/169866 to your computer and use it in GitHub Desktop.
use lib "$ENV{SHOOTOUT}/lib";
use lib "$ENV{SAKILA}";
use lib "$ENV{SAKILA}/DBIx/Class";
use SakSchema; # mysql source
use Sak2Schema; # sqlite target
use Sakila::DBH::MySQL;
my $mysql_schema = SakSchema->connect
(
sub { Sakila::DBH::MySQL->dbh }, {}
);
warn $mysql_schema;
my $sqlite_schema = Sak2Schema->connect
(
sub { Sakila::DBH::dbh }
);
warn $sqlite_schema;
my $rs = $mysql_schema->resultset('Actor')->search;
while (my $x = $rs->next) {
warn $x->first_name;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment