Views not loading correctly
Error: Error invoking remote method 'query': LibsqlError: SQLITE_ERROR: no such column: propertyIDs
select * from propertyIDs its working fine.
Thanks for reporting. I am looking into it.
Is this SQLite file, Cloudflare D1 or Turso?
Its a SQLite file.
Thats my schema
sqlite> .schema propertyIDs
CREATE VIEW propertyIDs AS SELECT * FROM (SELECT
(ROW_NUMBER() OVER (ORDER BY created)) AS id_number,
id,
table_name,
featured,
updated,
price,
for_sale,
off_market,
active,
long_address,
address,
created,
uploader
FROM (
SELECT id, 'houses' AS table_name, featured, price, for_sale, off_market, updated, active, long_address, address, created, uploader FROM houses
UNION
SELECT id, 'flats' AS table_name, featured, price, for_sale, off_market, updated, active, long_address, address, created, uploaderFROM flats
UNION
SELECT id, 'lands' AS table_name, featured, price, for_sale, off_market, updated, active, long_address, address, created, uploader FROM lands
) AS combined_table
ORDER BY created);
Can you toggle developer tool. Then click on view again. The console will tell which SQL does it execute. Can you copy and paste the SQL here?
Thanks
I has the same error by using libsql server.
This is what cause the problem:
SELECT * FROM "main".pragma_table_info("xxx");
xxx is a the view I'd like to open
I has the same error by using libsql server.
This is what cause the problem:
SELECT * FROM "main".pragma_table_info("xxx");xxx is a the view I'd like to open
Thanks for providing additional information. When you try to run
SELECT * FROM "main".pragma_table_info("xxx");
In the query tab, what error message does it provide? I have many views and using this SQL query will always returning the correct result. Is there any minimal steps that I can reproduce?
I has the same error by using libsql server.
Is it local libsql server or cloud-hosted provided by Turso?
- Download the libsql server binary: https://github.com/tursodatabase/libsql/releases/tag/libsql-server-v0.24.31
- Start it in a terminal
sqld --http-listen-addr=0.0.0.0:8080 - Connect to it via turso/libsql option in studio (url:
http://localhost:8080, token is empty) - Create table:
CREATE TABLE foo (bar text); - Create a view:
CREATE VIEW v_foo AS SELECT * FROM foo - Open the view