package back

type document struct {
	ID        int32  `json:"ID"`
	Caption   string `json:"Caption"`
	Link      string `json:"Link"`
	Extension string `json:"Extension"`
	Date      string `json:"Date"`
	Manager   int32  `json:"Manager"`
	Active    bool   `json:"Active"`

	Rows []document
}

func prepareQueriesDocument() []string {

	var e error
	ebox := make([]string, 0)

	queries["Insert#Document#"], e = db.Prepare(`INSERT INTO "Document"(
		"Caption", "Link", "Extension", "Date", "Manager", "Active")
		VALUES ($1, $2, $3, CURRENT_TIMESTAMP, $4, TRUE) RETURNING "ID"`)
	if e != nil {
		ebox = append(ebox, "Insert#Document# - "+e.Error())
	}

	return ebox
}

func (d *document) Insert() error {

	return nil
}
