Changed to check case insensitively (#132)

pull/139/head
mi-wada 3 years ago committed by GitHub
parent 403b9c7385
commit f96a573502
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -149,7 +149,7 @@ impl Pool for MySqlPool {
async fn execute(&self, query: &String) -> anyhow::Result<ExecuteResult> {
let query = query.trim();
if query.starts_with("SELECT") || query.starts_with("select") {
if query.to_uppercase().starts_with("SELECT") {
let mut rows = sqlx::query(query).fetch(&self.pool);
let mut headers = vec![];
let mut records = vec![];

@ -149,7 +149,7 @@ impl TableRow for Index {
impl Pool for PostgresPool {
async fn execute(&self, query: &String) -> anyhow::Result<ExecuteResult> {
let query = query.trim();
if query.starts_with("SELECT") || query.starts_with("select") {
if query.to_uppercase().starts_with("SELECT") {
let mut rows = sqlx::query(query).fetch(&self.pool);
let mut headers = vec![];
let mut records = vec![];

@ -152,7 +152,7 @@ impl TableRow for Index {
impl Pool for SqlitePool {
async fn execute(&self, query: &String) -> anyhow::Result<ExecuteResult> {
let query = query.trim();
if query.starts_with("SELECT") || query.starts_with("select") {
if query.to_uppercase().starts_with("SELECT") {
let mut rows = sqlx::query(query).fetch(&self.pool);
let mut headers = vec![];
let mut records = vec![];

Loading…
Cancel
Save