Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • FPC Source FPC Source
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 1,277
    • Issues 1,277
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 57
    • Merge requests 57
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Scheduled maintenance on the database layer will take place on 2022-07-02. We expect GitLab.com to be unavailable for up to 2 hours starting from 06:00 UTC. Kindly follow our status page for updates and read more in our blog post.

  • FPC
  • FPC
  • FPC SourceFPC Source
  • Issues
  • #20640
Closed
Open
Created Nov 07, 2011 by FPC Admin account@fpc_adminOwner

Support for SQLite load_extension (e.g. for Spatialite)

Original Reporter info from Mantis: BigChimp
  • Reporter name: Reinier Olislagers

Description:

The SQLite dll supports loading extension libraries (dlls/sos).
The attached patch enables this.
Note: you apparently must have an open database connection for this to work; the patch checks for this.

I intend to use this to load the Spatialite GIS extensions to SQlite, allowing me to manipulate GIS data easily without a client/server database server.

Additional information:

Patch tested on Win x86 FPC only

You can load an extension dll/so as an extension to SQLite, with a statement like [3]
select load_extension('libspatialite-4.dll');
However, before that you have to enable the extension load mechanism
using the C API [2]:
int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
(onoff==1 to turn extension loading on)

[2] http://www.sqlite.org/c3ref/enable_load_extension.html
[3] http://www.sqlite.org/lang_corefunc.html#load_extension

Example use within Lazarus:
DBConnection.DatabaseName:='osm.sqlite';
DBConnection.Open;
DBConnection.LoadExtension('libspatialite-4.dll');
//Note: we need an open db before doing this

Mantis conversion info:

  • Mantis ID: 20640
  • OS: Windows
  • OS Build: Vista
  • Build: fixes_2_6, r19599
  • Platform: x64
  • Version: 2.5.1
  • Fixed in revision: 20146 (#89866cd1)
  • Monitored by: » BigChimp (Reinier Olislagers)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking