1. Little question involving sqlite.dll
- Posted by jessedavis Mar 22, 2023
- 913 views
Euphoria 4.0.5 Windows 10 I often use Sqlite with Euphoria. Works great and is dependable. Use the Eu wrapper.
My question is: Suppose I want to include the Sqlite interface which is normally via a .dll
as a part of the compiled Euphoria program.
As an alternative I suppose that I could package the Euphoria.exe file with the .dll and use
an installer. The point is that I only want a one deliverable item .
How can I include it?
Thanks in advance.
jd
2. Re: Little question involving sqlite.dll
- Posted by ghaberek (admin) Mar 22, 2023
- 893 views
Euphoria 4.0.5 Windows 10 I often use Sqlite with Euphoria. Works great and is dependable. Use the Eu wrapper.
There currently isn't an "official" SQLite wrapper (yet). Closest we've got is the wrapper I wrote for EuMVC: db/sqlite3.e. Is that what you're using?
My question is: Suppose I want to include the Sqlite interface which is normally via a .dll as a part of the compiled Euphoria program.
This is called static linking and it's not something Euphoria currently supports, although it is technically possible. We'd need to add an option to the translator to indicate which libraries should be linked in, something euc -l sqlite.a -o myapp.exe myapp.ex and the existing define_c_func/proc() routines would have to be extended to find the C functions locally instead of reaching out to the DLL. It might require adding some conditional to call open_dll() differently or some alternative method altogether. The work I'm currently doing to implement libffi may help make this easier so I'll keep it in mind while I'm working through that.
As an alternative I suppose that I could package the Euphoria.exe file with the .dll and use an installer. The point is that I only want a one deliverable item.
You could put the exe and dll into a zip file. That's one item, I guess. Or maybe point the user to download the SQLite DLL on their own. Otherwise I don't have any other suggestions, sorry.
-Greg
3. Re: Little question involving sqlite.dll
- Posted by jessedavis Mar 22, 2023
- 896 views
Thanks for the quick reply! I am using eusqlite3.ew from the archives.
converted SQLite 28.15 21/12/2004 C M Burch
converted SQLite 3.0.8 21/12/2004 C M Burch
Thanks,
jd
4. Re: Little question involving sqlite.dll
- Posted by euphoric (admin) Mar 22, 2023
- 838 views
As an alternative I suppose that I could package the Euphoria.exe file with the .dll and use
an installer. The point is that I only want a one deliverable item .
How can I include it?
I currently use Inno Setup for that.
I'm using wxEuphoria, so I send all the wxWidgets dll files.
(wxWidgets is the best GUI for Euphoria. )
Works great!
5. Re: Little question involving sqlite.dll
- Posted by ghaberek (admin) Mar 23, 2023
- 746 views
Thanks for the quick reply! I am using eusqlite3.ew from the archives.
converted SQLite 28.15 21/12/2004 C M Burch
converted SQLite 3.0.8 21/12/2004 C M Burch
Oof, that's mighty old. Try using the wrapper I linked to instead. It's built around SQLite3 3.33.0 and includes a few helpful additions.
You can run make sqlite3 (or mingw32-make sqlite3 on Windows) to build the shared library from the files in the src/ directory.
Here are the functions I've added so far. Each of these will builds a parameterized statement, execute it, capture the result, finalize the statement, and return the result as indicated.
- sqlite3_exec_stmt() returns the status code of the statement, helpful for doing INSERT/UPDATE/DELETE
- sqlite3_exec_scalar() returns the first column of first row as {status,value}, helpful for querying IDs values, etc.
- sqlite3_query_row() returns first selected row as {status,row}, helpful for querying single items
- sqlite3_query_rows() returns all selected rows as {status,{row1,...}}, helpful for querying lists of items
- sqlite3_query_map() same as sqlite3_query_row() but the row is a map instead of a sequence
- sqlite3_query_maps() same as sqlite3_query_rows() but each row is a map instead of a sequence
- sqlite3_backup() uses the Online Backup API to export an open database to another file
-Greg
6. Re: Little question involving sqlite.dll
- Posted by ChrisB (moderator) Mar 23, 2023
- 702 views
There currently isn't an "official" SQLite wrapper (yet). Closest we've got is the wrapper I wrote for EuMVC: db/sqlite3.e. Is that what you're using?
Hi
Not strictly true. https://openeuphoria.org/wiki/view/eusqlite.wc. While not an official library, it has worked very well for years, based on Ray Smith's wrapper, used and modified by me for those years for my PMS.
Cheers
Chris
7. Re: Little question involving sqlite.dll
- Posted by ghaberek (admin) Mar 25, 2023
- 543 views
Not strictly true. https://openeuphoria.org/wiki/view/eusqlite.wc. While not an official library, it has worked very well for years, based on Ray Smith's wrapper, used and modified by me for those years for my PMS.
Right. I just meant that the wrapper in EuMVC is "closest" to official as I intend to make it official pretty soon. It's also based on a much more recent version of SQLite.
If there are aspects of Ray's code or your own that you'd like me to incorporate, please let me know so I can try to work those in before I release the wrapper with 4.2.
-Greg
8. Re: Little question involving sqlite.dll
- Posted by ChrisB (moderator) Mar 25, 2023
- 545 views
Hi
No no, not at all, I could almost cetainly not improve on what you're doing anyway. Rays has just been around a long time, is all.
Cheers
Chris