Changeset 47 in bookmarks for trunk/Bookmarks.pm


Ignore:
Timestamp:
06/03/13 20:28:59 (11 years ago)
Author:
peter
Message:
  • added a create_tables method to Bookmarks that uses the bookmarks.sql file to create the tables
  • added an "init" command to the bkmk script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Bookmarks.pm

    r46 r47  
    3131        } 
    3232    } 
     33} 
     34 
     35sub create_tables { 
     36    my $self = shift; 
     37    require File::Slurp; 
     38    my $table_definitions = File::Slurp::read_file('bookmarks.sql'); 
     39    $self->dbh->{sqlite_allow_multiple_statements} = 1; 
     40    $self->dbh->do($table_definitions); 
     41    $self->dbh->{sqlite_allow_multiple_statements} = 0; 
     42    return $self; 
    3343} 
    3444 
Note: See TracChangeset for help on using the changeset viewer.