Exemple #1
0
func initSQL() {
	if !checkFileExist(config.SQLDatabase) {
		fmt.Printf("%s not found, please run first ffetch\n", config.SQLDatabase)
	} else {
		cursor, _ = sqlite3.Open(config.SQLDatabase)
	}
}
Exemple #2
0
func initSQL() {
	cursor, _ = sqlite3.Open(config.SQLDatabase)

	query := "CREATE TABLE IF NOT EXISTS feed(" +
		"id        INTEGER PRIMARY KEY," +
		"site      TEXT," +
		"title     TEXT UNIQUE," +
		"link      TEXT," +
		"date      INTEGER," +
		"read      INTEGER);"

	cursor.Exec(query)
}