Function doteur_core::contains_sql_tables
source · pub fn contains_sql_tables(data: &str) -> bool
Expand description
Check if the given input contains sql tables
This function will with the given input ensure that the data passed contains at least one SQL table. If no table is detected in the data, the function will return false, otherwise, it will return true.
Arguments
data
- The content that we need to check the existence of SQL tables in.
Example
use doteur_core::contains_sql_tables;
// Normal use case
assert!(contains_sql_tables("
CREATE TABLE foo ( bar );
"));
assert!(contains_sql_tables("
CREATE TABLE `foo` ( bar );
"));
assert!(contains_sql_tables("
CREATE TABLE `FOOBAR` ( bar );
"));
assert_eq!(contains_sql_tables("
My table ;
"), false);