Implement writing price to db

This commit is contained in:
2024-08-24 16:28:46 +02:00
parent b799e1bbf7
commit d24a5c9307
2 changed files with 26 additions and 18 deletions

9
service.go Normal file
View File

@@ -0,0 +1,9 @@
package main
func SavePrice(db *DB, price int) error {
_, err := db.writeConn.Exec("INSERT INTO price(price) VALUES (?)", price)
if err != nil {
return err
}
return nil
}