MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / parse_delete

Method parse_delete

nodedb-sql/src/parser/array_stmt/parse_impl.rs:454–484  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

452 // ── DELETE FROM ARRAY ────────────────────────────────────────
453
454 pub(super) fn parse_delete(&mut self) -> Result<DeleteArrayAst> {
455 let name = self.expect_ident()?;
456 self.expect_kw("WHERE")?;
457 self.expect_kw("COORDS")?;
458 self.expect_kw("IN")?;
459 self.expect(&Tok::LParen)?;
460 let mut coords = Vec::new();
461 loop {
462 self.expect(&Tok::LParen)?;
463 let mut row = Vec::new();
464 loop {
465 row.push(self.parse_coord_literal()?);
466 if !self.match_token(&Tok::Comma) {
467 break;
468 }
469 }
470 self.expect(&Tok::RParen)?;
471 coords.push(row);
472 if !self.match_token(&Tok::Comma) {
473 break;
474 }
475 }
476 self.expect(&Tok::RParen)?;
477 if !self.at_end() {
478 return Err(self.err(format!(
479 "trailing tokens after DELETE FROM ARRAY: {:?}",
480 self.peek()
481 )));
482 }
483 Ok(DeleteArrayAst { name, coords })
484 }
485}
486
487fn default_domain_bounds(dtype: ArrayDimType) -> (ArrayDomainBound, ArrayDomainBound) {

Callers 1

Calls 8

expect_identMethod · 0.80
expect_kwMethod · 0.80
parse_coord_literalMethod · 0.80
match_tokenMethod · 0.80
at_endMethod · 0.80
expectMethod · 0.45
pushMethod · 0.45
errMethod · 0.45

Tested by

no test coverage detected