Closed louwers closed 6 months ago
Note that the sqlite3.capi
functions very specifically require the same number of arguments as their C counterparts except when very specifically noted in the docs (sqlite3_create_function()
and friends come to mind, as they accept Function args). We intentionally avoided "dumbing down" (for lack of a better term) the C-style API that way, primarily so that the C docs can be used for JS code most of the time (though we make heavy use of default args in the higher-level APIs).
That said, @tomayac is the overseer of the typescript-related stuff, so it's his call as to whether that design decision applies here.
@sgbeal I am not changing the number of arguments. But I did make a typo with the union (fixed now).
I'm not sure if null
will also work.
@sgbeal I am not changing the number of arguments.
Ah, indeed, my apologies. i completely misunderstood the patch to be providing a default of 0.
I'm not sure if
null
will also work.
Yes, it will. The JS-to-WASM conversion transforms null and undefined to integer 0 for pointer-passing purposes (wasm uses 32-bit ints for addresses).
@sgbeal No worries!
I confirmed null
also works. I created a new NullPointer
type for clarity. I'll leave it to @tomayac what the best approach is.
Going with null
sounds good to me. We can improve upon this if need be.
is the easiest way to monitor all tables for changes.
@louwers May I ask for the use case? Thank you
@louwers Interesting. Thinking whether I could use that to speed up reactive queries in https://github.com/evoluhq/evolu
is the easiest way to monitor all tables for changes. But this is not type-correct. This PR fixes that.