mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
wrap field and table names in backticks for sql queries
This commit is contained in:
parent
12fd95d8cf
commit
97ee1b91ef
1 changed files with 7 additions and 1 deletions
|
|
@ -110,7 +110,13 @@ export const QueryContainer: FC<{}> = () => {
|
|||
setLoading(false);
|
||||
}
|
||||
} else {
|
||||
querySQL(query, handleQueryMessages, handleQueryEnd);
|
||||
let queryArr = query.split(' ');
|
||||
queryArr.forEach((word, idx) => {
|
||||
if (word.includes('-') && !word.includes('`')) {
|
||||
queryArr[idx] = `\`${queryArr[idx]}\``;
|
||||
}
|
||||
});
|
||||
querySQL(queryArr.join(' '), handleQueryMessages, handleQueryEnd);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue