-
-
Save schwern/4cd618e7233aa71324dd84d878e31048 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use v5.10; | |
use DBI; | |
unlink "test.sqlite"; | |
my $dbh = DBI->connect( | |
"dbi:SQLite:dbname=test.sqlite", undef, undef, { RaiseError => 1, AutoCommit => 0 } | |
); | |
$dbh->do(<<SQL); | |
create table foo (id int, name text) | |
SQL | |
for my $num ( 1..1_000_000 ) { | |
$dbh->do(qq{ | |
insert into foo | |
values ($num, $num) | |
}); | |
} | |
$dbh->commit; | |
my $rows = $dbh->selectall_arrayref(<<SQL); | |
select * from foo limit 10000 | |
SQL | |
#$dbh->sqlite_backup_to_file("test.sqlite"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment