summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-06-06 18:04:09 -0400
committerBen Morrison <ben@gbmor.dev>2019-06-08 02:29:21 -0400
commit5fa9ec1b63acc6ac9dc0a8b5d2f8f044c27ea45e (patch)
treedb8be704869171895bf1702cb8504e1f08717a99
parente9d4a6b0e8624c6425d467f0efe14be1bc683bd9 (diff)
downloadgetwtxt-5fa9ec1b63acc6ac9dc0a8b5d2f8f044c27ea45e.tar.gz
working on adding sqlite
-rw-r--r--svc/db.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/svc/db.go b/svc/db.go
index e0c2690..f5e8678 100644
--- a/svc/db.go
+++ b/svc/db.go
@@ -8,6 +8,7 @@ import (
 	"time"
 
 	"github.com/getwtxt/registry"
+	_ "github.com/mattn/go-sqlite3"
 	"github.com/syndtr/goleveldb/leveldb"
 )
 
@@ -43,6 +44,12 @@ func initDatabase() {
 
 	case "sqlite":
 		var lite *sql.DB
+		lite, err := sql.Open("sqlite3", confObj.DBPath)
+		errFatal(err)
+		litePrep, err := lite.Prepare("CREATE TABLE IF NOT EXISTS getwtxt (urlKey TEXT PRIMARY KEY, isUser BOOL, blobKey TEXT, data BLOB)")
+		errFatal(err)
+		_, err = litePrep.Exec()
+		errFatal(err)
 		db = &dbSqlite{db: lite}
 
 	case "postgres":
tter hut <hut@lavabit.com> 2010-03-30 04:50:38 +0200 added SignalDispatcher class' href='/akspecs/ranger/commit/test/tc_signal.py?h=v1.4.1&id=1c1b6c31de513f0f056a915bf7d8e608c485ae50'>1c1b6c31 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134