You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'm trying to chunk queries into batches so that I can be under the 35kb limit. In doing so, I ran into an error TypeError: sql.trim is not a function, but I'm not using that function in my code.
I'm not necessarily sure if the chunking process is correct, but that doesn't matter—the sql.trim is not a function shouldn't appear for me. Here's the exact errror:
file:///Users/dtb/Desktop/t/node_modules/@tableland/sdk/dist/esm/statement.js:27
this.sql = sql.trim();
^
TypeError: sql.trim is not a function
at new Statement (file:///Users/dtb/Desktop/t/node_modules/@tableland/sdk/dist/esm/statement.js:27:24)
at Database.prepare (file:///Users/dtb/Desktop/t/node_modules/@tableland/sdk/dist/esm/database.js:49:16)
at main (file:///Users/dtb/Desktop/t/t.js:51:37)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Desktop (please complete the following information):
OS: Mac M1
Node: v18.12.1
SDK: ^4.0.0-pre.8
Local Tableland: ^1.0.0-pre.4
The text was updated successfully, but these errors were encountered:
Is it possible that your function is creating an undefined input into the prepare statement? Clearly we need to catch this potential error, that but seems like it might be the cause (because if it were a valid string, then sql.trim() would be a function).
Looks like the value of statement is [ undefined ], which obviously isn't a string. I'll open a PR to pass a more human friendly error message in a second.
Describe the bug
I'm trying to chunk queries into batches so that I can be under the 35kb limit. In doing so, I ran into an error
TypeError: sql.trim is not a function
, but I'm not using that function in my code.To Reproduce
Here's a gist of the code: https://gist.github.com/dtbuchholz/5264be5c7081268a7ddee864bad8ec03
I'm not necessarily sure if the chunking process is correct, but that doesn't matter—the
sql.trim is not a function
shouldn't appear for me. Here's the exact errror:Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: