You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
390 B

1 year ago
  1. package mysql
  2. import (
  3. "database/sql"
  4. "git.aiterp.net/rpdata2-take2/rpdata2/internal/genutils"
  5. )
  6. func toNullString(s *string) sql.NullString {
  7. if s != nil {
  8. return sql.NullString{Valid: true, String: *s}
  9. } else {
  10. return sql.NullString{Valid: false}
  11. }
  12. }
  13. func fromNullString(ns sql.NullString) *string {
  14. if ns.Valid {
  15. return genutils.Ptr(ns.String)
  16. } else {
  17. return nil
  18. }
  19. }