TheMathemagicians/sevenkeys/cmd/importdata/main.go

31 lines
474 B
Go
Raw Normal View History

package main
import (
"database/sql"
"log"
2024-04-23 16:52:48 +00:00
"sevenkeys/database"
"sevenkeys/scryfall"
)
2024-04-23 16:52:48 +00:00
func importSets(db *sql.DB) {
setList, err := scryfall.GetSets()
if err != nil {
log.Fatal(err)
}
2024-04-23 16:52:48 +00:00
err = database.InsertSets(db, setList)
if err != nil {
log.Fatal(err)
}
}
func main() {
2024-04-23 16:52:48 +00:00
db := database.GetDatabaseFromConfig("config.json")
importColors(db)
importSets(db)
// Import keywords
// Import formats
// Import artists
// Import gamepieces and printings
}