MCPcopy Create free account
hub / github.com/apache/datafusion / sql_dialect

Function sql_dialect

datafusion-cli/src/helper.rs:307–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305
306 #[test]
307 fn sql_dialect() -> Result<()> {
308 let mut validator = CliHelper::default();
309
310 // should be invalid in generic dialect
311 let result =
312 readline_direct(Cursor::new(r"select 1 # 2;".as_bytes()), &validator)?;
313 assert!(
314 matches!(result, ValidationResult::Invalid(Some(e)) if e.contains("Invalid statement"))
315 );
316
317 // valid in postgresql dialect
318 validator.set_dialect(&Dialect::PostgreSQL);
319 let result =
320 readline_direct(Cursor::new(r"select 1 # 2;".as_bytes()), &validator)?;
321 assert!(matches!(result, ValidationResult::Valid(None)));
322
323 Ok(())
324 }
325
326 #[test]
327 fn test_split_from_semicolon() {

Callers

nothing calls this directly

Calls 3

readline_directFunction · 0.85
newFunction · 0.85
set_dialectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…