dyedgreen/deno-sqlite

Expose the `#this.#open` property on the DB class instance

Closed this issue · 8 comments

Here there seems to be a property that checks if the connection is still open. I would like to know if this can be exposed to the end-user.

My use-case would be due to this issue. I wasn't able to get the full API working but I would like to attempt to see if this package could be a viable option.

I think adding something along the lines of isClosed could make sense. The property is checked my a bunch of the other functions already, and it seems useful generally to know if close has been called.

It’s also extremely simple to implement:

get isClosed(): boolean {
  return !this.#open;
}

If you’re happy to make a PR, I can review and release a new version with this changes 😊

I think adding something along the lines of isClosed could make sense. The property is checked my a bunch of the other functions already, and it seems useful generally to know if close has been called.

It’s also extremely simple to implement:

get isClosed(): boolean {
  return !this.#open;
}

Ahh ok yh this makes sense, I can open a PR for that

While I am here, do you know if there is a method that allows the user to run a query retrieving data if there is any? It's apart of the original implementation, though I haven't run into instances where I noticed that. and lastly I am unsure about if there is a bigint mode.

yes this seems to have deployed without the ffi issues I was experiencing with the denodrivers' implimplementation.

run a query retrieving data if there is any

Not sure what you mean by that? There is a query method on DB.

lastly I am unsure about if there is a bigint mode

You can insert BigInts into the database, and if you get back an integer that JS can’t represent as a number it’s returned as a BigInt.

Ah perfect, once this PR is merged I may need to ask if you can look at the code for the libsql Deno client just so I know I am using the appropriate features. Thank you