I recently migrated from tql to diesel, as tql didn't appear to have a very complete mapping of commands to SQL.
Right now using diesel on Windows is a real pain involving multiple workarounds:
https://github.com/diesel-rs/diesel/issues/487
It'd be ideal if diesel could offer a "bundled" feature like rusqlite:
https://github.com/jgallagher/rusqlite
This made builds on Windows virtually painless.
Thanks.
Just realized this is probably easier than i thought - the "bundled" feature is actually on libsqlite3-sys. So you can do
libsqlite3-sys = { version = "0.9.1", features = ["bundled"] }
Would still be nice if this was a diesel feature for convenience purposes (not sure if it could apply to postgresql if it's enabled, but that would make sense). It should definitely be documented somewhere.
Running into similar issues on windows. I managed to get diesel_cli to install, after using lib.exe to convert the sqlite3.dll into sqlite3.lib, put it in rust's lib path, and get started. However, I then face issue where running diesel setup breaks looking for api-ms-win-crt-heap-l1-1-0.dll. A bundled feature would be great, especially since I'm planning to package sqlite along with my app.
Take a look at my post just above yours. If you include that in your Cargo.toml in addition to diesel, diesel will use libsqlite3-sys with the bundled feature and it should obviate the need for messing with the DLLs and libs. That's what I used to get diesel working with our CI system.
It would be nice if this feature will be added to diesel (especially diesel_cli) for windows users...
The workaround from @spease works for diesel as a dep but not for diesel_cli because it's not possible to install a lib (as far as I know) system wide. So it should be easy to implement and it will have a huge benefit for windows users!
@stahlstift It is not required to add this as a feature to diesel itself, because one could easily specify the bundled linking there using @spease method. (Adding a feature flag for this wouldn't make it easier…)
For diesel-cli there is already #1302, which needs someone to fix the remaining review comments.
Well I am not an expert with the rust ecosystem - but why not add a feature for it (e.G. sqlite-bundle)?
This should prevent us for version conflicts in Cargo and my app will use the version of libsqlite3-sys diesel wants to use.
Update: ok #1302 has the same idea with sqlite-bundle
Fixed by #1672
Most helpful comment
Just realized this is probably easier than i thought - the "bundled" feature is actually on libsqlite3-sys. So you can do
Would still be nice if this was a diesel feature for convenience purposes (not sure if it could apply to postgresql if it's enabled, but that would make sense). It should definitely be documented somewhere.