Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2 (probably) SQLite only error Messages. #21

Closed
alexbodn opened this issue Nov 21, 2023 · 4 comments
Closed

2 (probably) SQLite only error Messages. #21

alexbodn opened this issue Nov 21, 2023 · 4 comments

Comments

@alexbodn
Copy link

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:

  • create temp table t2 as
    WITH t1(x,y,n,color) AS (VALUES
    (100,100,3,'red'),
    (200,100,4,'orange'),
    (300,100,5,'green'),
    (400,100,6,'blue'),
    (500,100,7,'purple'),
    (100,200,8,'red'),
    (200,200,10,'orange'),
    (300,200,12,'green'),
    (400,200,16,'blue'),
    (500,200,20,'purple')
    )
    SELECT * FROM t1;
    -- table t2 already exists

  • ATTACH DATABASE '/proj/proj.db' AS proj;
    -- database proj is already in use

again, a big thank
alex

@jvail
Copy link
Owner

jvail commented Nov 24, 2023

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
Copy link
Author

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
Copy link
Author

alexbodn commented Dec 1, 2023

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
Copy link
Owner

jvail commented Dec 1, 2023

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

@jvail jvail closed this as completed Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants