Comments (7)
Bundling the SQLite library into this module would require bundling for all three platforms, and two different architectures for macOS, which would be a big size increase when downloading and caching module, also there is no way to bundle a native binary into JS module. There are some hacky approaches like base64 encoding and writing as a string in JS file, but it really only has downsides IMO. Only viable option seems dynamically downloading at runtime and caching the binary.
from sqlite3.
Now this library downloads and uses its own prebuilt version of SQLite3 which ensures safety and consistency across platforms. I'll be closing this issue as fixed
from sqlite3.
There is also https://deno.land/x/sqlite which bundles a sqlite WASM build
from sqlite3.
There is also https://deno.land/x/sqlite which bundles a sqlite WASM build
Yep, sqlite (wasm) is able to do that by encoding wasm binary in base64 and writing to a JS file which can be simply imported and automatically cached by Deno. That approach is viable only for wasm since it has same binary for all OS and arch.
Downloading and caching native libraries at runtime is something we can consider. Ideally, sqlite should be built in CI and published along with release and that release URL to be used by code to download.
from sqlite3.
Hello - if I wanted to make my own solution for this, where would I deploy the [lib]sqlite3.dll/so/dynlib
file on the end-users system? Right next to the binary for my app?
Also, would that same libsqlite3
file be needed during Deno compilation? In other words, do I need to supply the DENO_SQLITE_PATH
during build-time (compiling) or at runtime? I am not familiar with how FFI works, but I am guessing that the libsqlite3
linked library would not be necessary when building my app's binary, with Deno.
If I put libsqlite3
right next to my app's binary, will it automatically get picked up from there?
Looking at the code now, I see that you call Deno.dlopen
and I would guess that just works at runtime exclusively. However, I did not find out much about the search path that it uses.
I'd also like to not have to build sqlite into my CI pipeline if I didn't have to - is there a well known set of sqlite3 builds that I can draw from?
(I can probably figure these out soon; I'm still debating if I want to try and use Deno for this app that I have in mind.)
Thanks!
from sqlite3.
where would I deploy the [lib]sqlite3.dll/so/dynlib file on the end-users system? Right next to the binary for my app?
Yeah, CWD is one place we look for in first
but I am guessing that the libsqlite3 linked library would not be necessary when building my app's binary, with Deno.
That's right, we do dynamic linking
Actually this might be something desirable now. Recently found out that SQLite3 compiled with certain flags can increase the performance of the library and provide more consistent results across platforms. But we sure can't bundle, just shipping our own binary would be the goal.
from sqlite3.
As an update, we now use custom built SQLite3 libraries on macOS and Linux since it has been observed to improve performance. Same could be done for Windows but there were not any performance gains so there we still use system library which is present in most cases.
from sqlite3.
Related Issues (20)
- Unsafe pointer create exception HOT 4
- Bug in Reading Integers HOT 1
- `Failed to load SQLite3 Dynamic Library` – example code not working HOT 6
- SQL statement not support chinese ? HOT 1
- Running in a Web Worker HOT 6
- Different API to node-sqlite3 HOT 5
- Error: Failed to load SQLite3 Dynamic Library HOT 3
- Permission denied when trying to only allow access to a certain ffi path HOT 1
- Error: no such table: fsdir HOT 3
- Compiled binary throws zlib dependency error HOT 10
- SQLITE_ENABLE_UPDATE_DELETE_LIMIT does not work on Linux HOT 2
- Allow configuring libsqlite location HOT 2
- bump sqlite bundled version to 3.45 HOT 1
- Extensions and Callbacks prevent using this library with macOS bundled dylib HOT 6
- "TypeError: Invalid ArrayBuffer pointer, pointer is null" while reading blob column HOT 8
- Standardize SQL database interface for TS/JS
- `new Database()` in Web Worker freezing HOT 4
- Use tagged releases of SQLite HOT 3
- Open database readOnly not working HOT 3
- Fts5 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlite3.