chore: update sqlite functions

This commit is contained in:
Steven
2023-12-17 14:16:34 +08:00
parent a9071d629a
commit 41cb597f03
8 changed files with 37 additions and 98 deletions

View File

@ -1,5 +1,9 @@
package store
import (
storepb "github.com/yourselfhosted/slash/proto/gen/store"
)
// RowStatus is the status for a row.
type RowStatus string
@ -20,6 +24,16 @@ func (e RowStatus) String() string {
return ""
}
func ConvertRowStatusStringToStorepb(status string) storepb.RowStatus {
switch status {
case "NORMAL":
return storepb.RowStatus_NORMAL
case "ARCHIVED":
return storepb.RowStatus_ARCHIVED
}
return storepb.RowStatus_ROW_STATUS_UNSPECIFIED
}
// Visibility is the type of a visibility.
type Visibility string