Skip to content

Cannot use CTE and read_html() function  #17

@marcoarthur

Description

@marcoarthur

Trying to select more than one selector I wrote the following CTE
But, anyquery returned this error:

anyquery> WITH files AS (
.........   SELECT * FROM read_html('http://localhost:8000/', '.mtime')
.........   UNION
.........   SELECT * FROM read_html('http://localhost:8000/', '.size')
......... )
......... SELECT * 
......... FROM files;
no such table: read_html
anyquery> 

But I am able to run the SELECT outside the CTE:

anyquery> SELECT * FROM read_html('http://localhost:8000/', '.mtime');
+----------+-------------------------------+--------------------------------------+
| tag_name |            content            |              attributes              |
+----------+-------------------------------+--------------------------------------+
| td       | Wed, 21 Aug 2024 14:13:54 GMT | [{"Namespace":"","Key":"class","Val" |
|          |                               | :"mtime"}]                           |
| td       | Wed, 21 Aug 2024 14:18:21 GMT | [{"Namespace":"","Key":"class","Val" |
|          |                               | :"mtime"}]                           |
| td       | Wed, 21 Aug 2024 14:13:54 GMT | [{"Namespace":"","Key":"class","Val" |
|          |                               | :"mtime"}]                           |
| td       | Wed, 21 Aug 2024 14:15:45 GMT | [{"Namespace":"","Key":"class","Val" |
|          |                               | :"mtime"}]                           |
| td       | Mon, 16 Sep 2024 13:51:08 GMT | [{"Namespace":"","Key":"class","Val" |
|          |                               | :"mtime"}]                           |
+----------+-------------------------------+--------------------------------------+

My anyquery: anyquery version 0.1.3 (built with go1.22.6 for linux/amd64)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions