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

Function parse_timing_token

nodedb-sql/src/ddl_ast/parse/trigger.rs:191–213  ·  view source on GitHub ↗
(tokens: &[String], i: &mut usize)

Source from the content-addressed store, hash-verified

189}
190
191fn parse_timing_token(tokens: &[String], i: &mut usize) -> String {
192 if *i >= tokens.len() {
193 return "AFTER".to_string();
194 }
195 match tokens[*i].as_str() {
196 "BEFORE" => {
197 *i += 1;
198 "BEFORE".to_string()
199 }
200 "AFTER" => {
201 *i += 1;
202 "AFTER".to_string()
203 }
204 "INSTEAD" => {
205 *i += 1;
206 if *i < tokens.len() && tokens[*i] == "OF" {
207 *i += 1;
208 }
209 "INSTEAD OF".to_string()
210 }
211 _ => "AFTER".to_string(),
212 }
213}
214
215fn parse_event_tokens(tokens: &[String], i: &mut usize) -> (bool, bool, bool) {
216 let (mut insert, mut update, mut delete) = (false, false, false);

Callers 1

parse_create_triggerFunction · 0.85

Calls 3

to_stringMethod · 0.80
lenMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected