Closed eyeseast closed 1 year ago
Patch coverage: 100.00
% and project coverage change: +0.03
:tada:
Comparison is base (
c0251cc
) 96.25% compared to head (afdf618
) 96.29%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
Aah, I think I see why you wrote it like that.
The problem is that init_spatialite()
does other stuff too:
So it needs to be able to load the SpatiaLite extension from the correct place, and THEN run select InitSpatialMetadata()
to configure the database, if needed.
So the problem you're trying to solve here is to let people optionally pass in the path to SpatiaLite if it's not one of the ones that are searched by default.
Exactly, that's what I was running into. On my M2 MacBook, SpatiaLite ends up in what is -- for the moment -- a non-standard location, so even when I passed in the location with --load-extension
, I still hit an error on create-spatial-index
.
What I learned doing this originally is that SQLite needs to load the extension for each connection, even if all the SpatiaLite stuff is already in the database. So that's why init_spatialite()
gets called again.
Here's the code where I hit the error: https://github.com/eyeseast/boston-parcels/blob/main/Makefile#L30 It works using this branch.
I'm not attached to this solution if you can think of something better. And I'm not sure, TBH, my test would actually catch what I'm after here.
I'm going to close this in favor of #536. Will try a cleaner approach to custom paths once that one is merge.
This also passes in the extension path when specified in GIS methods. Wherever we know an extension path, we use
db.init_spatialite(find_spatialite() or load_extension)
.:books: Documentation preview :books:: https://sqlite-utils--531.org.readthedocs.build/en/531/