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

SQLite3 in the box, or binary module support. #5605

Closed
tracker1 opened this issue May 18, 2020 · 8 comments
Closed

SQLite3 in the box, or binary module support. #5605

tracker1 opened this issue May 18, 2020 · 8 comments

Comments

@tracker1
Copy link

One of the first things I looked for was a sqlite module for Deno. There is one, but it's a webassembly build, and wouldn't work with multi-process access to the sqlite3 database file.

The second thing I did was look to see if there was an API/Interface or library to be able to create a library for SQLite3 as a rust/binary module.

TBH, other than SQLite, I'm not sure that there is much need for a binary module support in Deno itself, so would suggest either adding a SQLite3 interface in Deno itself, or add binary module support.

@hayd
Copy link
Contributor

hayd commented May 18, 2020

Doesn't this module solve? https://github.com/crabmusket/deno_sqlite_plugin

RE multiprocess, perhaps you should open an issue in (either/both) project?

@agusbena
Copy link

Would binary modules break the runtime sandbox security feature? How Deno would control the i/o access there?

@ghost
Copy link

ghost commented May 20, 2020

@tracker1

other than SQLite, I'm not sure that there is much need for a binary module support in Deno itself

Serial port, openCV, native math libs, etc, etc. With a good built-in ffi, deno could become a real python killer. I don’t even mind if this is done on top of the protobuf IPC

@tracker1
Copy link
Author

@hayd the issue is the wasm module doesn't interact with a sqlite database file. It's in memory and the save method is destructive. Meaning only single process access, which is problematic.

I'd actually love to see a wasm file system interface that's flushed out enough to interact with sqlite3 databases with other processes as it's designed to.

Failing that, good ffi primitives would be nice.

@ghost
Copy link

ghost commented May 21, 2020

@tracker1

I'd actually love to see a wasm file system interface that's flushed out enough to interact with sqlite3 databases with other processes as it's designed to

Do you think this will be enough? For example, WASI fs API looks too "high level". In libraries like SqLite, specific OS abstractions are often used to make everything work well. For example, a file locking or mmap. I do not think that WASI will be enough for many cases

@tracker1
Copy link
Author

Looks like native plugins are supported, probably need to have documentation updated... though compilation and distribution of plugins, I'm not sure of, or if the api is well defined enough to remain stable over version changes.

#3372

@tracker1
Copy link
Author

@makoven no, the WASI spec isn't complete enough for something like SQLite... but did discover there is some native module support... so going to explore that a little... I'm crazy inexperienced with rust though... I've read a book, and played with it in two projects, but every time I've looked at it again, feels like I'm starting over.

@bartlomieju
Copy link
Member

@TracKer Deno supports binary plugins, PTAL at test_plugin example: https://github.com/denoland/deno/blob/master/test_plugin/src/lib.rs

Adding SQLite bindings is outside of scope for Deno.

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

4 participants