-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't pass table name from variable without {}
#77
Comments
May I know what is the use-case for this? Because prepared statements are not supported for table names. Now describing what happened in your case:
Important Note:If this was for demonstration, it's okay. But never send |
@amandesai01 I was creating a endpoint to dynamically fetch the table name e.g. This application I was building was to view the data on the application side and the user will select what table they want to view. Almost like DataGrip, Table Plus etc.. |
You must use some enums / strict validation. You may create a set of valid values and make sure value exists in set before sending it to query or whatever. |
I run into this today. Thanks for the |
Environment
Darwin
v20.10.0
3.11.1
3.11.1
2.9.5
bun@1.1.3
-
css
,devtools
,modules
,fonts
,shadcn
,eslint
,experimental
,nitro
@nuxt/fonts@0.5.1
,@nuxtjs/tailwindcss@6.11.4
,@pinia/nuxt@0.5.1
,shadcn-nuxt@0.10.2
,@nuxt/eslint@0.3.0-beta.6
-
Reproduction
I will add one here soon.
Describe the bug
Additional context
It seems to work fine if I add the
{}
around the variable but maybe that was intended and isn't documented.Logs
near "?": syntax error at Database.prepare (node_modules/better-sqlite3/lib/methods/wrappers.js:5:21) at Object.prepare (node_modules/db0/connectors/better-sqlite3.mjs:24:29) at Object.sql (node_modules/db0/dist/index.mjs:34:38) at Object.handler (server/api/tables/[name].get.ts:9:1) at node_modules/h3/dist/index.mjs:1890:43 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async node_modules/h3/dist/index.mjs:1962:19 at async Object.callAsync (node_modules/unctx/dist/index.mjs:72:16) at async Server.toNodeHandle (node_modules/h3/dist/index.mjs:2249:7)
The text was updated successfully, but these errors were encountered: