Skip to content

Instantly share code, notes, and snippets.

@vojtechkral
Created January 11, 2024 01:37
Show Gist options
  • Save vojtechkral/96e631eeeb387154f281dc7fc703f1b0 to your computer and use it in GitHub Desktop.
Save vojtechkral/96e631eeeb387154f281dc7fc703f1b0 to your computer and use it in GitHub Desktop.
SQL Rust polyglot
select !( --); /*
0);
-- */ pub const QUERY_1: &str = r##"
SELECT foo, bar FROM baz WHERE foo > 10;
-- "##; pub const QUERY_2: &str = r##"
DELETE FROM baz where foo > 9001;
-- "##;
mod sql {
macro_rules! select {
(--) => {};
}
include!("poly.rs.sql");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment