Changeset 47 in bookmarks


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
Location:
trunk
Files:
2 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 
  • trunk/bkmk

    r26 r47  
    2020 
    2121my %action_for = ( 
     22    init => sub { 
     23        $bookmarks->create_tables; 
     24    }, 
    2225    get => sub { 
    2326        my $identifier = shift; 
Note: See TracChangeset for help on using the changeset viewer.