You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to either incorporate the mathematical extension (extension-functions.c) into the core application or provide it as a compiled extension?
Since I'm not very familiar with C compiling I may have to insist on my original proposal. Notwithstanding my own capabilities, it seems others would benefit from official support, too.
Hi @Bilge,
I also think it would be a great addition to the queries to be able to add these math functions.
Huge EDIT. I had many troubles. I made it work, the problem was quite stupid, loading a 32 bit extension on a 64bit DB Browser installation.
The error (which was in Spanish) was not very helpful, since it only said "Module not found"
I have the .so extension compiled for both 32 and 64 bits for Windows. Both work 😄 extension-functions.zip
Reacted by Justin Clift, blhayward, xandyxor and isalazar14
Any interest in writing up the steps on our Wiki so others can figure out similar for other extensions? Also, I might be able to follow along them and get it added into the official packaging process. 😄
I can confirm that the extension-functions can be compiled and works also for Ubuntu 16.04. Here is a sin plot directly copied from the plot dock and pasted here (you can now do that 😄)
Looking at the .c source file now, it has basic instructions for compiling on Linux and OSX at the top. Sounds like it'll be fairly easy on those platforms. Windows though... I'm having trouble figuring out the steps it'd need. 😕
Just got it compiled and working on CentOS 7. Cool. 😄
I wonder if there's a way we could have these automatically compiled into our builds (as per @Bilge 's request)? eg so no manual step needs to be done by the user to load them. Might play around with this a bit later, and see...
As a data point, just received a response from Liam Healy, pointing at his canonical source repo for the functions. He accepts PR's (etc), in case anyone wants to expand things out and so on. 😄
One of the emails referenced in this thread said " Also note that the typing on sqlite3_auto_extension() pointer is wrong. " If anyone has a patch to fix the problem, I'll take it if it's been tested. I'm a bit embarrassed that I said to post problems to the mailing list - I think I must have dropped off that mailing list years ago, so I haven't seen anything that's posted.
I'm thinking "it shouldn't", but lets take a quick look at some Task Manager memory use figures to make sure.
😆
Windows isn't the best OS for this. Start up DB4S. 21.2 MB. Open a database. Jumps to 27.2 MB just opening the 'browse for database' dialog. Increases to 33 MB when I cancel that dialog. After a bit (flipped back to Edge to look up something) and its dropped back down to 10.9 MB. Windows is doing wacky things with the memory! In typing the above, its increased to 14.7 MB and I haven't done anything. Now 21 MB. Loaded the extension and it hasn't moved.
Short answer (without fiddling some more) it'll have very little impact on performance. Certainly takes milliseconds to load, etc.
@SilvioGrosso That video you created showing the load of the math extension + calling a function from it was really helpful. Used that to make sure I was getting it correct for the macOS compilation of it today.
Do you have a YouTube account or similar for putting it on? Thinking we could point people to it.
Actually, might be better to make an updated one showing the exactly correct location to load from math.dll (Win) / math.dylib (macOS), so there's no ambiguity for people?
Just recorded a new video tutorial by way of the latest beta (3°) released today.
I have worked on Windows 10 (64 bit).
I have showed both the standard deviation (on numbers) and the reverse funciton (on strings) available with the math extension.
In my very short video tutorial I also show how to locate the extension on Windows 10 (64 bit)
You can try to look for my video tutorial on YouTube, by typing:
Db Browser for sqlite - Math extension
You can easily download this video from YouTube in case you need it for your personal use.
BTW, feel free to ask for other video tutorials in case you need them...
As usual, I can record them on Windows 10 (64 bit) with OBS [1]; I edit them with Shotcut [2].
No audio voice is added on my video tutorials since my British pronunciation sucks (I am an Italian guy) :-)
BTW, feel free to ask for other video tutorials in case you need them...
Cool. That would be really welcome. Any interest in maybe setting up some kind of official DB4S channel for them on YouTube and getting stuff created there? 😄
... my British pronunciation sucks (I am an Italian guy).
Yeah, I'm an Aussie. My (spoken) English tends to have swear words in it. 👼
Any interest in maybe setting up some kind of official DB4S channel for them on YouTube and getting stuff created there?
Sure. No problem at all.
At present, I am waiting for the stable version to be released in order to ascertain what features I can show in my video tutorials.
For instance, many latest addition as "the uncomment code button", in the Execute SQL tab, are not available in the 3° beta. They are present in the nightly builds for future releases :-)
Yeah. It's taking a bunch of time to get 3.11 released. Tonnes of stuff (mostly not directly programming) has needed doing. That's all mostly done now, thus the speed up in releasing betas in the last few days. 😄
Noticed something with our Windows build batch files today. The maths extension for them is only being included with the SQLite builds, not the SQLCipher ones.
We should probably get it added to the SQLCipher ones too.
The maths extension for them is only being included with the SQLite builds, not the SQLCipher ones.
Since both SQLite and SQLCipher are included together, did you mean built against SQLite and not SQLCipher?
I don't think that's necessary. The same .dll works for both SQLite and SQLCipher. Just tested it to confirm.
It is just being built after SQLite in the build batch files, but it doesn't have to be. The reason is that it needs sqlite3ext.h header file to get the names of some of the required function, like sqlite3_load_extension. These functions exist in SQLite and SQLCipher.
We build SQLite first, then move the extension .c/.def to the same folder (where sqlite3ext.h exist) and build there. We can also build it first, before SQLite and SQLCipher, by copying sqlite3ext.h file, from either, to its folder.
Thanks @karim. Yep, that was me forgetting we only need it built once, as both .exe's get installed in the same place.
I'd probably just been faked out by looking through the macOS stuff before it, as that still needs to build both SQLite and SQLCipher completely separately. 😄
So yeah, the math extension on Win is fine as-is. My bad. 😇
Activity
justinclift commentedon Nov 12, 2017
Interesting thought. If you compile it yourself, you should be able to load it in the extensions part of Preferences.
Which OS are you using?
Bilge commentedon Nov 12, 2017
Windows 7.
justinclift commentedon Nov 12, 2017
k, you can probably get the extension compiled by setting up MSVC 2013 using the steps here:
I've not personally tried to compile external SQLite extensions though, so you'd likely need to experiment a bit.
Bilge commentedon Nov 12, 2017
Since I'm not very familiar with C compiling I may have to insist on my original proposal. Notwithstanding my own capabilities, it seems others would benefit from official support, too.
struck89 commentedon Dec 14, 2017
Hi @Bilge,
I also think it would be a great addition to the queries to be able to add these math functions.
Huge EDIT. I had many troubles. I made it work, the problem was quite stupid, loading a 32 bit extension on a 64bit DB Browser installation.
The error (which was in Spanish) was not very helpful, since it only said "Module not found"
I have the .so extension compiled for both 32 and 64 bits for Windows. Both work 😄
extension-functions.zip
justinclift commentedon Dec 14, 2017
@struck89 Wow, that's really, really awesome!
Any interest in writing up the steps on our Wiki so others can figure out similar for other extensions? Also, I might be able to follow along them and get it added into the official packaging process. 😄
justinclift commentedon Dec 14, 2017
@Bilge Do you have a few moments to test out the extension compiled by @struck89?
mgrojo commentedon Dec 14, 2017
I can confirm that the extension-functions can be compiled and works also for Ubuntu 16.04. Here is a sin plot directly copied from the plot dock and pasted here (you can now do that 😄)
justinclift commentedon Dec 14, 2017
Muaaa Haaa Haaa. This is really good stuff.
Looking at the .c source file now, it has basic instructions for compiling on Linux and OSX at the top. Sounds like it'll be fairly easy on those platforms. Windows though... I'm having trouble figuring out the steps it'd need. 😕
Just got it compiled and working on CentOS 7. Cool. 😄
I wonder if there's a way we could have these automatically compiled into our builds (as per @Bilge 's request)? eg so no manual step needs to be done by the user to load them. Might play around with this a bit later, and see...
justinclift commentedon Dec 15, 2017
Looking into the history of this extension code, it seems to be public domain:
https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg16048.html
That being the case, adding them into our builds wouldn't introduce any licensing problems (important). 😄
justinclift commentedon Dec 15, 2017
This might also be useful reference info too. Not sure yet.
justinclift commentedon Dec 15, 2017
@liamh Are there any gotchas we should keep an eye out for?
Note - Hoping you're the correct Liam Healy there. 😉
justinclift commentedon Dec 15, 2017
As a data point, just received a response from Liam Healy, pointing at his canonical source repo for the functions. He accepts PR's (etc), in case anyone wants to expand things out and so on. 😄
https://gitlab.com/liamh/extension-functions
liamh commentedon Dec 15, 2017
You do have the right person.
One of the emails referenced in this thread said " Also note that the typing on sqlite3_auto_extension() pointer is wrong. " If anyone has a patch to fix the problem, I'll take it if it's been tested. I'm a bit embarrassed that I said to post problems to the mailing list - I think I must have dropped off that mailing list years ago, so I haven't seen anything that's posted.
43 remaining items
chrisjlocke commentedon Dec 4, 2018
😆
Windows isn't the best OS for this. Start up DB4S. 21.2 MB. Open a database. Jumps to 27.2 MB just opening the 'browse for database' dialog. Increases to 33 MB when I cancel that dialog. After a bit (flipped back to Edge to look up something) and its dropped back down to 10.9 MB. Windows is doing wacky things with the memory! In typing the above, its increased to 14.7 MB and I haven't done anything. Now 21 MB. Loaded the extension and it hasn't moved.
Short answer (without fiddling some more) it'll have very little impact on performance. Certainly takes milliseconds to load, etc.
justinclift commentedon Dec 4, 2018
Cool, that's probably all we needed to check, just to be on the safe side. 😄
justinclift commentedon Dec 13, 2018
@SilvioGrosso That video you created showing the load of the math extension + calling a function from it was really helpful. Used that to make sure I was getting it correct for the macOS compilation of it today.
Do you have a YouTube account or similar for putting it on? Thinking we could point people to it.
Actually, might be better to make an updated one showing the exactly correct location to load from
math.dll(Win) /math.dylib(macOS), so there's no ambiguity for people?SilvioGrosso commentedon Dec 13, 2018
Hello @justinclift
Just recorded a new video tutorial by way of the latest beta (3°) released today.
I have worked on Windows 10 (64 bit).
I have showed both the standard deviation (on numbers) and the reverse funciton (on strings) available with the math extension.
In my very short video tutorial I also show how to locate the extension on Windows 10 (64 bit)
You can try to look for my video tutorial on YouTube, by typing:
Db Browser for sqlite - Math extension
However, here is the direct link:
https://www.youtube.com/watch?v=UDqowNoFJIo
You can easily download this video from YouTube in case you need it for your personal use.
BTW, feel free to ask for other video tutorials in case you need them...
As usual, I can record them on Windows 10 (64 bit) with OBS [1]; I edit them with Shotcut [2].
No audio voice is added on my video tutorials since my British pronunciation sucks (I am an Italian guy) :-)
[1] https://obsproject.com/
[2] https://shotcut.org/
justinclift commentedon Dec 13, 2018
Excellent. Just updated the 3.11.0-beta3 release info with a pointer to it.
Cool. That would be really welcome. Any interest in maybe setting up some kind of official DB4S channel for them on YouTube and getting stuff created there? 😄
Yeah, I'm an Aussie. My (spoken) English tends to have swear words in it. 👼
SilvioGrosso commentedon Dec 14, 2018
Hello @justinclift
Sure. No problem at all.
At present, I am waiting for the stable version to be released in order to ascertain what features I can show in my video tutorials.
For instance, many latest addition as "the uncomment code button", in the Execute SQL tab, are not available in the 3° beta. They are present in the nightly builds for future releases :-)
justinclift commentedon Dec 14, 2018
Yeah. It's taking a bunch of time to get 3.11 released. Tonnes of stuff (mostly not directly programming) has needed doing. That's all mostly done now, thus the speed up in releasing betas in the last few days. 😄
justinclift commentedon Jan 19, 2019
Noticed something with our Windows build batch files today. The maths extension for them is only being included with the SQLite builds, not the SQLCipher ones.
We should probably get it added to the SQLCipher ones too.
karim commentedon Jan 19, 2019
Since both SQLite and SQLCipher are included together, did you mean built against SQLite and not SQLCipher?
I don't think that's necessary. The same .dll works for both SQLite and SQLCipher. Just tested it to confirm.
It is just being built after SQLite in the build batch files, but it doesn't have to be. The reason is that it needs
sqlite3ext.hheader file to get the names of some of the required function, likesqlite3_load_extension. These functions exist in SQLite and SQLCipher.We build SQLite first, then move the extension .c/.def to the same folder (where
sqlite3ext.hexist) and build there. We can also build it first, before SQLite and SQLCipher, by copyingsqlite3ext.hfile, from either, to its folder.justinclift commentedon Jan 19, 2019
Thanks @karim. Yep, that was me forgetting we only need it built once, as both .exe's get installed in the same place.
I'd probably just been faked out by looking through the macOS stuff before it, as that still needs to build both SQLite and SQLCipher completely separately. 😄
So yeah, the math extension on Win is fine as-is. My bad. 😇
karim commentedon Jan 19, 2019
No worries. 😄
Should we close this issue or wait till the 3.11 release?
justinclift commentedon Jan 19, 2019
Ahh yeah. Closing it. 😄
New argument for saving settings