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

not yet implemented for SQLNUll #134

Closed
subos2008 opened this issue Jan 31, 2025 · 2 comments
Closed

not yet implemented for SQLNUll #134

subos2008 opened this issue Jan 31, 2025 · 2 comments

Comments

@subos2008
Copy link

I'm getting the error message not yet implemented for SQLNUll when trying to insert the null value for a column.

With code like this:

      const sql = `INSERT OR REPLACE INTO "${table_name}" (a, b, c)
      VALUES (?, ?, ?);`

      try {
        await connection.run(sql, [
          foo,
          bar,
          foobar || null,
        ])

When I look into the code it looks like create_null is missing from the cpp level bindings and we throw that exception here with a comment: // TODO: implement when available in 1.2.0

Is that something difficult to implement or should I be writing my SQL differently there? Both my cpp and SQL are a bit rusty.

I changed my code to || 'NULL' for the moment but that's not ideal.

Many thanks for your work, I just found DuckDB and it makes my project a million times easier.

@jraymakers
Copy link
Contributor

Yes, this is a known limitation with DuckDB 1.1.3. As you noticed, create_null was not in the C API for DuckDB 1.1.3; it was added since then and is due to be released in DuckDB 1.2.0, which should go out next week (if all goes well). Once that's out, I plan to update Node Neo to support binding NULL, as well as several other types for which support was added to the C API since 1.1.3. This is tracked by #86. (I just added a reminder about NULL to that issue, since it wasn't mentioned specifically. I'll close this issue in favor of that broader one.)

@jraymakers
Copy link
Contributor

Glad to hear you're enjoying DuckDB and this library!

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

2 participants