public CsvUpdateCommand(string s) : base(s) { var parser = CsvCommandParser.GetInstance(); var match = Pattern.Match(s); if (!match.Success) { throw new Exception("Cannot parse into update command"); } var updateStr = match.Groups[1].Value; Updaters = parser.ParseUpdaters(updateStr); var conditionStr = match.Groups[2].Value; Condition = parser.ParseCondition(conditionStr); CommandType = CsvCommandType.Update; }
public CsvSelectCommand(string s) : base(s) { var parser = CsvCommandParser.GetInstance(); var match = Pattern.Match(s); if (!match.Success) { throw new Exception("Cannot parse into select command"); } var headerStr = match.Groups[1].Value; Headers = parser.ParseHeaders(headerStr); AllHeaders = Headers.Count == 1 && Headers[0] == "*"; var conditionStr = match.Groups[2].Value; Condition = parser.ParseCondition(conditionStr); CommandType = CsvCommandType.Select; }