Skip to content
Snippets Groups Projects
Unverified Commit 9800aee6 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Initial add message sql

parent 41663fb9
No related branches found
No related tags found
No related merge requests found
// Package folders are all the routines and sql for managing folders.
package folders
import "time"
// CreateMessage creates a new folder.
func (s *Store) CreateMessage(author, subject, message, folder string, permanent, shutdown int, expiration *time.Time) error {
_, err := s.db.Exec(
`INSERT INTO messages
(id, folder, author, subject, message, permanent, shutdown, expiration)
VALUES
($1, $2, $3, $4, $5, $6, $7, $8)`,
1, // TODO: how to set this.
folder,
author,
subject,
message,
permanent,
shutdown,
expiration, // TODO: handle this being NULL
)
// TODO: process this error a bit more to give a better error message.
return err
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment