Re: [gnome-db] loading sqlite extensions with gda?

Vivien Malerba <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <CAEP1ZNm+kb97pdG+B1qoCALn5mhHv9URU5JmK1OZZVn0DMn2dw@mail.gmail.com>
On 22 October 2011 19:45, Leibowitz, Michael <[email protected]>wrote:

> Hi,
>
> I'm trying to use the spatialite plugin to sqlite3 through gda (gdamm,
> actually), without much luck.  I'm trying to load the plugin as
> follows:
>
>  _connection->statement_execute_select(
>      "SELECT load_extension('libspatialite.so.2')");
>
> I don't get an error with that (it doesn't throw, at least), but the
> next line throws:
>   _connection->statement_execute_select("SELECT InitSpatialMetadata()");
> I get a "no such function" message in the error.
>
> Is it possible to load extensions into sqlite3 this way?  Is there
> another way?  Am I doing something obviously wrong?  Why don't I get
> an error from the SELECT load_extension?
>
>
Hi!

I had never had to load extensions, so I had never tested it. However it
should work...

I have added a new option to pass when opening an SQLite connection
("EXTENSIONS=TRUE") to enable extensions loading (as a security measure as
mentionned on SQLite's web site).

This is now corrected in Git master branch (see
http://git.gnome.org/browse/libgda/commit/?id=1c2327652b24a7c457d52496b1973082bd7871ea)
and will be part of the 4.2.10 and 5.0 versions.

See the standalone example attached I used to make the test (using an
example extension).

Regards,
Vivien

_______________________________________________
gnome-db-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-db-list
20111023_sqlite_extension.tbz (application/x-bzip-compressed-tar, 1.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.