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

Disconnect method #32

Open
danbulant opened this issue Jan 25, 2024 · 0 comments
Open

Disconnect method #32

danbulant opened this issue Jan 25, 2024 · 0 comments

Comments

@danbulant
Copy link

There doesn't seem a way to explicitly disconnect from the database, which means if using local file system (rocksdb://), the database will stay locked and be unusable for as long as the program runs.

I'm working on an electron application, using the database from a preload script to have it be isolated, and each refresh also reloads the preload script, which makes it try to connect again. But since the process itself isn't destroyed, the value in rust is never dropped, or at least not in a reasonable timeframe.

I don't know much about napi, but maybe it's a simple case of adding a disconnect method that consumes self, i.e.

surrealdb.node/src/lib.rs

#[napi]
pub fn disconnect(self) -> Result<()> {}
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