Replace Prefix Table for Query in common CMS #952
valentino-90
started this conversation in
Ideas
Replies: 1 comment
-
A response a bit outdated, but I suppose that there's a tool for this already, change your settings to something like this in your workspace "sqltools.queryParams.enableReplace": true,
"sqltools.queryParams.regex": "\\$[\\d]+|([@:][\\w]+)|(\\$\\[[\\w]+\\])",
"sqltools.connections": [
{
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"driver": "PostgreSQL",
"name": "MyDb",
"group": "Locals",
"database": "world-db",
"username": "world",
"password": "world123",
"askForPassword": false,
"variables": {
":name": "'%e%'",
}
}
] Then, if I do the following query, it'll automatically match and replace the ":name" param, but will ask you what to replace, in this case, I need to put the column name SELECT *
FROM city
WHERE $[whatToSearch] ILIKE :name; See https://github.com/mtxr/vscode-sqltools/blob/dev/packages/util/query/index.ts#L58 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Run query from code, with a prompt input for pre-replace table prefix (joomla #__, wordpress => {$wpdb->prefix}) before run
Beta Was this translation helpful? Give feedback.
All reactions