Does TiddlyWiki have a Database? How the tiddlers are stored inside Tiddlywiki?
I want to access an External Database, which contains complex data. How can I access data from Tiddlywiki? Does it support a query mechanism? ( My DB queries contain main join operations as well, kind of complex query)
At the moment TW does not use a database internally. The tiddlers are stored in an JS object-store for fast access.
Internally TW maintains some indices and caches to optimize performance. Eg for tags and filters.
I do not understand this one. Do you want to access an external database from within TiddlyWiki or do you want to access an external database with a 3rd party tool?
If you need an API to access TW data from a 3rd party tool, you will need to run a Node.js server, which loads the TW content into memory. The TW server will allow you to request JSON data.
The TW query language are “filter expressions” as used with the TW list-widget.
Yeah…in my case the database is an external one, example a DB running on my machine or cloud. Kind of private db. So I need to run a nodejs as a middleware to handle the calls. Am I right?
You can use empty.html. Create a JSON file that contains a TW data-store as described above and concatenate those 2 files from a CLI – into a single file wiki.
The next time the TW will be opened, it will contain all the tiddlers from the store.
Until your browser will crash. There are wikis out there, with 30k+ tiddlers.
But – It depends, what you want to achieve?
TiddlyWiki was designed to be a self-contained wiki. So it’s 1 HTML file, that contains all the data. So if you want to store text-based content it will be fine. If you want to store binary data it’s probably the wrong tool.
In my case data is not constant, it will vary from the options I select and data can be updated by someone else. So data is constant at all.
For instance , if I did the same now. But there is a chance that someone might have changed the data. So I need the recent data rather than the older one.
I don’t have full control over the Database, I am just using it from a 3rd party.
Since the data is private can’t expose into API calls from tiddly.
OK. I think that’s the right approach. The TW server has a possibility to “lazy-load” the tiddler body “content”. So the title and all fields are transferred to the browser. So you can efficiently filter your lists.
As soon as a tiddler is show, the content will be dynamically loaded from the TW server. This can speed up the initial load time significantly.
@linonetwo has a huge wiki that works that way. May be he can jump in here?
I am following this sqlite3 WebAssembly & JavaScript Documentation Index and I hope that by the time I learn the basics of the filter language, somebody who is much smarter than me will release an sqlite TiddlyWiki plugin which will provide an alternative to said filter language for managing tiddlers Albeit I have no idea about the size inflation rate of a single file wiki that would bundle such a plugin.