jvail / spl.js

SpatiaLite for browser & node
GNU General Public License v3.0
168 stars 17 forks source link

2 (probably) SQLite only error Messages. #21

Closed alexbodn closed 10 months ago

alexbodn commented 10 months ago

Salut @jvail mon ami,

First, a big thank for helping me play with gis sql on the phone in my hand. there are two bug manifestations of sqlite in general, that i haven't encountered with other versions, on either linux or wasm. As the following queries do work, even in spatialite, but give (similar) error messages, probably, compiling against newer sqlite (I'm using 3.41 on wasm and 3.43 on linux) would remove the error messages.

So the queries:

again, a big thank alex

jvail commented 10 months ago

Salut @alexbodn,

not sure but the first one. Looks like you have executed the query twice (?). And attaching an open db is probably not possible. In general ATTACH should work. However, here is a fresh build with the latest spatialite & sqlite: https://github.com/jvail/spl.js/tree/spatialite-5.1.0/dist. Would you like to give it a try?

Jan

alexbodn commented 10 months ago

a big thank my friend! sure i will be delighted try 5.1.0. now i suspect my program ran the same query twice. a few moments.

alexbodn commented 10 months ago

the bug was mine indeed. i previously didn't understand exec().get, so i was calling it twice.

spatialite 5.1.0 seems to work, at least london loads ok. thank you very much mon ami! to load it, i had to disable the initial parameters to SPL():

    const spl = await SPL(
        /*[],
        {
            autoGeoJSON: 0 ? false : {
                precision: 6,
                options: 0,
            },
        },*/
    );

these parameters weren't very important to me.i just played with them, and they previously worked as i would expect.

thank you very much, spl.js gives me much joy!

jvail commented 10 months ago

Très bien! Thank you for the feedback.

to load it, i had to disable the initial parameters to SPL():

Oh, ja. I changed the API for the rc because I found it a bit inconvenient to always pass the empty extensions array first and then the options. It is just the other way round now: https://github.com/jvail/spl.js/blob/main/dist/index.js#L53