summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authordakkar <dakkar@luxion>2005-10-19 18:49:40 +0000
committerdakkar <dakkar@luxion>2005-10-19 18:49:40 +0000
commit3852abfb5c39807cc238e46bf7247e1afcd4cca9 (patch)
tree40430160276afa01ecffdd156c578e241ae0da63 /script
parenttemplate iniziale (diff)
downloadBookmarks-3852abfb5c39807cc238e46bf7247e1afcd4cca9.tar.gz
Bookmarks-3852abfb5c39807cc238e46bf7247e1afcd4cca9.tar.bz2
Bookmarks-3852abfb5c39807cc238e46bf7247e1afcd4cca9.zip
fatto il db
Diffstat (limited to 'script')
-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
+);