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

Named parameters, how? #109

Open
markg85 opened this issue Aug 6, 2024 · 0 comments
Open

Named parameters, how? #109

markg85 opened this issue Aug 6, 2024 · 0 comments

Comments

@markg85
Copy link

markg85 commented Aug 6, 2024

Hi,

image

I was following this video (https://www.youtube.com/watch?v=U6k7HnQiWzc) and tried to do the same in js.
While the nodejs API has ...params for nearly every function, it seems like named paramaters isn't a thing on the js side?

I couldn't get it working.
For example:

    const result = await db.run(`SELECT a, b, array_cosine_similarity(
        embedding, $searchVector::FLOAT[1024]) as score FROM x ORDER BY score DESC LIMIT $limit`, {"searchVector": await embeddingContext.getEmbeddingFor("test"), "limit": 10});
    console.log(result);

Returns:

[Error: Invalid Input Error: Values were not provided for the following prepared statement parameters: limit, searchVector] {
  errno: -1,
  code: 'DUCKDB_NODEJS_ERROR',
  errorType: 'Invalid Input'
}

It should be on par with what python does yet it is just not working. It is not implemented for the js side of things?

Sidenote, i'm running duckdb-async but it wraps this library so errors there probably originate here.

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