document.go 718 B

123456789101112131415161718192021222324252627282930313233
  1. package back
  2. type document struct {
  3. ID int32 `json:"ID"`
  4. Caption string `json:"Caption"`
  5. Link string `json:"Link"`
  6. Extension string `json:"Extension"`
  7. Date string `json:"Date"`
  8. Manager int32 `json:"Manager"`
  9. Active bool `json:"Active"`
  10. Rows []document
  11. }
  12. func prepareQueriesDocument() []string {
  13. var e error
  14. ebox := make([]string, 0)
  15. queries["Insert#Document#"], e = db.Prepare(`INSERT INTO "Document"(
  16. "Caption", "Link", "Extension", "Date", "Manager", "Active")
  17. VALUES ($1, $2, $3, CURRENT_TIMESTAMP, $4, TRUE) RETURNING "ID"`)
  18. if e != nil {
  19. ebox = append(ebox, "Insert#Document# - "+e.Error())
  20. }
  21. return ebox
  22. }
  23. func (d *document) Insert() error {
  24. return nil
  25. }