Skip to content
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

Insert return type mismatch #99

Open
rrd108 opened this issue Jun 20, 2024 · 0 comments
Open

Insert return type mismatch #99

rrd108 opened this issue Jun 20, 2024 · 0 comments

Comments

@rrd108
Copy link

rrd108 commented Jun 20, 2024

Environment

Nuxt 3.13
Node 18

Reproduction

export default defineEventHandler(async event => {
  const db = useDatabase()
  const res = await db.sql`INSERT INTO orders VALUES (null, ${data.name})`
  return res
})

Describe the bug

If the INSERT was successful res will be {success: true}

Typescript infer the type as DefaultSQLResult

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant