Browse Source

InsertToken

master
Elis Axelsson 5 years ago
parent
commit
368c25d03f
  1. 20
      src/WorstCaptcha/Db.go

20
src/WorstCaptcha/Db.go

@ -23,13 +23,23 @@ func NewDb() Db {
}
db.Exec(`
CREATE TABLE IF NOT EXISTS (
"id" integer NOT NULL PRIMARY KEY,
"word" text,
"identifier" text,
"added" datetime
CREATE TABLE IF NOT EXISTS tokens (
"id" integer NOT NULL PRIMARY KEY,
"word" text,
"token" text
);
`)
return Db{db}
}
func (d *Db) InsertToken(word string, token string) {
stmt, _ := d.Client.Prepare(`
INSERT INTO tokens("word", "token")
VALUES (?, ?)
`)
defer stmt.Close()
stmt.Exec(word, token)
}

Loading…
Cancel
Save