How can I read a non-XML (specifically CSV) file that is stored in a BaseX database from a query?
csv:doc()
expects a URI, how do I point it to a file inside the database?
Asked
Active
Viewed 89 times
2

Mehmet Aydin
- 31
- 2
1 Answers
1
Ooh, I think I got it:
csv:parse(convert:binary-to-string(db:retrieve("db", "path/to/file.csv"), 'UTF-8')
Or is there an easier way?

Mehmet Aydin
- 31
- 2
-
1You are right, that’s currently the only way. `db:retrieve` could possibly be replaced with something like `db:raw-text` and `db:raw-binary`; we thought about that in the past. Thanks for the observation. – Christian Grün May 24 '21 at 11:25