fixing tabs
This commit is contained in:
parent
040633b7be
commit
0c8bd064e3
2 changed files with 13 additions and 14 deletions
27
main.go
27
main.go
|
|
@ -5,16 +5,15 @@ import (
|
|||
"log"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
)
|
||||
|
||||
// Book is a placeholder for book
|
||||
type Word struct {
|
||||
word_id int
|
||||
source_id int
|
||||
previous string
|
||||
source_id int
|
||||
previous string
|
||||
current string
|
||||
next string
|
||||
count int
|
||||
next string
|
||||
count int
|
||||
}
|
||||
|
||||
type Source struct {
|
||||
|
|
@ -60,14 +59,14 @@ func main() {
|
|||
FOREIGN KEY(source_id) REFERENCES sources(source_id)
|
||||
);
|
||||
`).Exec()
|
||||
log.Println("Done making tables!")
|
||||
log.Println("Done making tables!")
|
||||
|
||||
log.Println("Making indexes...")
|
||||
prep_query(db, "CREATE INDEX words_sources_index ON words(source_id)").Exec()
|
||||
log.Println("Done making indexes!")
|
||||
log.Println("Making indexes...")
|
||||
prep_query(db, "CREATE INDEX words_sources_index ON words(source_id)").Exec()
|
||||
log.Println("Done making indexes!")
|
||||
|
||||
log.Println("Inserting source/word...")
|
||||
prep_query(db, `
|
||||
log.Println("Inserting source/word...")
|
||||
prep_query(db, `
|
||||
INSERT INTO sources
|
||||
(name)
|
||||
VALUES
|
||||
|
|
@ -100,8 +99,8 @@ func main() {
|
|||
tempWord.word_id, tempWord.current, tempWord.next, tempWord.source_id)
|
||||
}
|
||||
|
||||
// Update
|
||||
prep_query(db, "UPDATE sources SET name=? WHERE source_id=?").Exec("Monqu2", 1)
|
||||
// Update
|
||||
prep_query(db, "UPDATE sources SET name=? WHERE source_id=?").Exec("Monqu2", 1)
|
||||
|
||||
rows, _ = db.Query("SELECT source_id, name FROM sources")
|
||||
for rows.Next() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue