Deduplicate (and stabilize) the result of _collapse_cond
[dbsrgits/DBIx-Class.git] / examples / Schema / insertdb.pl
old mode 100644 (file)
new mode 100755 (executable)
index a701795..c57460e
@@ -3,13 +3,12 @@
 use strict;
 use warnings;
 
-use MyDatabase::Main;
+use MyApp::Schema;
 
-my $schema = MyDatabase::Main->connect('dbi:SQLite:db/example.db');
+use Path::Class 'file';
+my $db_fn = file($INC{'MyApp/Schema.pm'})->dir->parent->file('db/example.db');
 
-#  here's some of the sql that is going to be generated by the schema
-#  INSERT INTO artist VALUES (NULL,'Michael Jackson');
-#  INSERT INTO artist VALUES (NULL,'Eminem');
+my $schema = MyApp::Schema->connect("dbi:SQLite:$db_fn");
 
 my @artists = (['Michael Jackson'], ['Eminem']);
 $schema->populate('Artist', [