You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
443 B
Go
24 lines
443 B
Go
package sqlite
|
|
|
|
import (
|
|
"git.phc.dm.unipi.it/phc/website/database"
|
|
"github.com/jmoiron/sqlx"
|
|
)
|
|
|
|
type sqliteDBDownloads struct{ *sqlx.DB }
|
|
|
|
var _ database.DBDownloads = sqliteDBDownloads{}
|
|
|
|
func (d sqliteDBDownloads) Create(template database.Download) error {
|
|
if _, err := d.DB.NamedExec(`
|
|
INSERT INTO
|
|
downloads(dispensa_id, timestamp)
|
|
VALUES
|
|
(:dispensa_id, :timestamp)
|
|
`, &template); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|