public enum BatchTrack { Backfill, LiveCapture }

public static class BatchTrackExtensions
{
    public static string ToDbString(this BatchTrack t) => t switch
    {
        BatchTrack.Backfill    => "BACKFILL",
        BatchTrack.LiveCapture => "LIVE_CAPTURE",
        _ => throw new ArgumentOutOfRangeException(nameof(t))
    };

    public static BatchTrack FromDbString(string v) => v switch
    {
        "BACKFILL"     => BatchTrack.Backfill,
        "LIVE_CAPTURE" => BatchTrack.LiveCapture,
        _ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown batch track: '{v}'")
    };
}