Augment the logic from aca094b4d, add deprecation to settle the distinct drama
[dbsrgits/DBIx-Class.git] / examples / Schema / insertdb.pl
index 15bf71b..c57460e 100755 (executable)
@@ -5,11 +5,10 @@ use warnings;
 
 use MyApp::Schema;
 
-my $schema = MyApp::Schema->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', [