summaryrefslogtreecommitdiff
path: root/script/bookmarks_makedb.pl
diff options
context:
space:
mode:
Diffstat (limited to 'script/bookmarks_makedb.pl')
-rw-r--r--script/bookmarks_makedb.pl44
1 files changed, 44 insertions, 0 deletions
diff --git a/script/bookmarks_makedb.pl b/script/bookmarks_makedb.pl
new file mode 100644
index 0000000..84e2fd5
--- /dev/null
+++ b/script/bookmarks_makedb.pl
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use DBI;
+use FindBin;
+use Path::Class;
+
+my $DBHOME=dir($FindBin::Bin)->parent->file('bookmarks.db');
+
+my $db=DBI->connect("dbi:SQLite:$DBHOME");
+
+local $/='';
+while (<DATA>) {
+ my $rv=$db->do($_);
+ warn 'Problemi: '.$db->errstr() unless $rv;
+}
+
+__DATA__
+drop table links_tags;
+
+drop table links;
+
+drop table tags;
+
+create table links (
+ pk integer primary key autoincrement,
+ url text unique,
+ descr text,
+ icon blob,
+ add_date integer,
+ last_access_date integer,
+ access_count integer
+);
+
+create table tags (
+ pk integer primary key autoincrement,
+ name text unique,
+ descr text
+);
+
+create table links_tags (
+ link integer,
+ tag integer
+);