Skip to main content

split

Function split 

Source
pub fn split(text: &str) -> Result<Vec<String>>
Expand description

The text split into statements, with text that does not tokenize handed back whole.

crate::statements is the same split and refuses text it cannot tokenize, which is the right answer for a shell, since the commonest reason is a string the user has not closed. It is the wrong answer for a harness reading a file of other people’s SQL, whose job is to hand each statement to both engines and see what they say rather than to decide in advance that something is not SQL. This is that second reading.

§Errors

Never. It returns a Result so that a caller can use it where crate::statements would go, and so that a later reason to refuse has somewhere to live.