Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-15 Thread Chris Wolf


Richard Hipp wrote:
> On Mon, Nov 15, 2010 at 7:39 AM, Chris Wolf  wrote:
>
>   
>> sqlite> .load mylib
>> unknown command or invalid arguments:  "load". Enter ".help" for help
>>
>> ...and it's not listed with ".help"
>>
>> I have release 3.4.0 on Mac OS 10.5.
>>
>>
>> 
> Bummer.  I guess Leopard compiled with -DSQLITE_OMIT_LOAD_EXTENSION.
>
> I suggest downloading a pre-compiled binary from the SQLite website and
> using that instead.
>
>
>   

There was no precompiled binary for Mac - only sqlite-analyzer.   It was
easy enough to build from
amalgam source.  I you want, I can make a binary build for MacOS - not
just a tar/zip but an installer
package wrapped in a dmg to post on your site.  Otherwise I'm good to go
- thanks.


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-15 Thread Richard Hipp
On Mon, Nov 15, 2010 at 7:39 AM, Chris Wolf  wrote:

>
>
> sqlite> .load mylib
> unknown command or invalid arguments:  "load". Enter ".help" for help
>
> ...and it's not listed with ".help"
>
> I have release 3.4.0 on Mac OS 10.5.
>
>
Bummer.  I guess Leopard compiled with -DSQLITE_OMIT_LOAD_EXTENSION.

I suggest downloading a pre-compiled binary from the SQLite website and
using that instead.



>   -Chris
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-15 Thread Chris Wolf


Richard Hipp wrote:
> On Fri, Nov 12, 2010 at 12:08 PM, Chris Wolf  wrote:
>
>   
>> I tried to explicitly load an extension via:
>>
>> sqlite> select load_extension('mylib');
>> SQL error: no such function: load_extension
>>
>> 
>
> Use the ".load" command in the sqlite3.exe command-line shell.
>
>   

sqlite> .load mylib
unknown command or invalid arguments:  "load". Enter ".help" for help

...and it's not listed with ".help"

I have release 3.4.0 on Mac OS 10.5.

   -Chris

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/12/2010 09:08 AM, Chris Wolf wrote:
> If so, does that mean we can't use the out-of-the box shell and must
> re-compile with a 'C' code change to invoke this?  If that's true, why wasn't 
> this
> simply controlled via an environment variable?

C code has to enable extension loading.  If you use the SQLite shell
then it always calls the C function to enable extension loading.
Remember that SQLite is always a library in part of a larger process.
It is up to that process to decide policy on extension with the safe
default being to have it disabled.

> Assuming this *had* worked, I assume the shared library naming convention is
> that of the dlopen library call,

Correct.  Look for UnixDlOpen and WinDlOpen in the SQLite source where
you see that they just directly call dlopen and LoadLibraryW.  To my
knowledge there is no convention for file names for SQLite extensions.
My test extension has the imaginative filename under all operating
systems of testextension.sqlext.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzdhfUACgkQmOOfHg372QT9AACcDS4Qmtoc93lggQyF5krhMThq
Db8An24hI6UDBNwuazQjEHeUqmbcc3MR
=+B/F
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] uncertainty how load_extension is supposed to work

2010-11-12 Thread Chris Wolf
I tried to explicitly load an extension via:

sqlite> select load_extension('mylib');
SQL error: no such function: load_extension


Is this because of the default setting of "enable_load_extension"?
http://www.sqlite.org/c3ref/enable_load_extension.html

If so, does that mean we can't use the out-of-the box shell and must
re-compile
with a 'C' code change to invoke this?  If that's true, why wasn't this
simply
controlled via an environment variable?

Assuming this *had* worked, I assume the shared library naming convention is
that of the dlopen library call, although this behavior may not jive
with Windows.  Maybe it's like Java's LoadLibrary?  i.e. ignore
the file extension (.so, .dll, .dylib) and drop the "lib" prefix.  

e.g. to load "libmylib.dylib" on Mac, it's:
select load_extension('mylib');

...which would correspond to "libmylib.dll" on Windows, etc.

Is that how it is?  

Can it be documented on this page? :

http://www.sqlite.org/lang_corefunc.html#load_extension


Thanks,


   -Chris


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] uncertainty how load_extension is supposed to work

2010-11-12 Thread Richard Hipp
On Fri, Nov 12, 2010 at 12:08 PM, Chris Wolf  wrote:

> I tried to explicitly load an extension via:
>
> sqlite> select load_extension('mylib');
> SQL error: no such function: load_extension
>

Use the ".load" command in the sqlite3.exe command-line shell.


>
>
> Is this because of the default setting of "enable_load_extension"?
> http://www.sqlite.org/c3ref/enable_load_extension.html
>
> If so, does that mean we can't use the out-of-the box shell and must
> re-compile
> with a 'C' code change to invoke this?  If that's true, why wasn't this
> simply
> controlled via an environment variable?
>
> Assuming this *had* worked, I assume the shared library naming convention
> is
> that of the dlopen library call, although this behavior may not jive
> with Windows.  Maybe it's like Java's LoadLibrary?  i.e. ignore
> the file extension (.so, .dll, .dylib) and drop the "lib" prefix.
>
> e.g. to load "libmylib.dylib" on Mac, it's:
> select load_extension('mylib');
>
> ...which would correspond to "libmylib.dll" on Windows, etc.
>
> Is that how it is?
>
> Can it be documented on this page? :
>
> http://www.sqlite.org/lang_corefunc.html#load_extension
>
>
> Thanks,
>
>
>   -Chris
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users