parseDql method

BrokerQueryCommand? parseDql(
  1. String str
)

Implementation

BrokerQueryCommand? parseDql(String str) {
  if (str.startsWith('[')) {
    return parseList(DsaJson.decode(str));
  }
  // TODO: implement full dql spec
  // this is just a temp quick parser for basic /data node query
  var commands = str.split('|').map((x) => x.trim()).toList();
  if (commands.length == 2 &&
      commands[0].startsWith('list /data') &&
      commands[1].startsWith('subscribe')) {
    var path = commands[0].substring(5);
    BrokerQueryCommand? listcommand = QueryCommandList(path, this);
    listcommand = _getOrAddCommand(listcommand);
    if (listcommand == null) {
      return null;
    }
    BrokerQueryCommand? subcommand = QueryCommandSubscribe(this);
    subcommand.base = listcommand;
    subcommand = _getOrAddCommand(subcommand);
    return subcommand;
  }
  return null;
}