How to use IndexedDB ?

I want to write some html files that use IndexedDB *, then a Xojo application (using SQLite) will deal with the data base contents **.

I actually am stopped at “where the h**l the data are stored ?”
(not much far I wrote a four fields web page: two Texts, one Popup and two RadioButtons).
I wasted three days to be there :frowning:

Every clue is welcome.

  • Creation, add new Records with an html page.
    ** Display the database contents, etc. (everything we do with a DataBase with a Desktop application.

PS: my best found html page is:
IndexedDB.

The Browser saves all these data locally, you access that with javascript in the code of your website.
Here is an example

I thought it was sandboxed and you needed to. ‘Download’ the data to work with it…

[quote=383918:@Emile Schwarz]Where ?
I just finished a scan of my hard disk for .sqlite files: nothing related to my tries was found.[/quote]

That information is unneeded and you won’t get it. Of course I really believe it won’t be an .sqlite-file ggg

Not possible, not needed, not wanted. I’m sure, you completely haven’t understand what indexeddb does.

[quote=383918:@Emile Schwarz]After a “good night”, I know now how to explain where I am in the “understanding” of this technique.

Imagine you want to use SQLite in a Xojo Desktop application, and the only documentation you have is the one at sqlite.com.
YOU DO NOT HAVE XOJO’s ocn documentation, especially the description of the SQLiteDataBase Class.
So: I cannot do db.SQLSelect nor db.SQLExecute because I do not have the documentation.[/quote]

Let me repeat: You completely haven’t understand what indexeddb does.
To explain some things about it:

—> Please forget Xojo at this moment! It is possible to use indexddb with xojowebapp, but at this point it makes everything difficult.

Speaking about a typical Website, Server and Client: Normally all data is stored on the Server.
With indexddb you are able to store data on the clientside. So you are able to build a website that is displaying data while it is NOT connected to the server. That is done with JAVASCRIPT!!! The Browser offers you the possibility to save, modify an read data on the client. This is a blackbox. The Browser does all the things like handling the db-file for you. You are NOT able to access the db-file from the Server! It works like “dictionary” in Xojo - with the difference, this is an persistent dictionary on the clientside.

Perhaps it makes no sense to use indexeddb with xojo? A xojowebapp isn’t able to go offline from the server. So normally there is no need to store data locally?

Marius

You can do so, but you don’t need (couldn’t use!!!) indexeddb so far. Use App.HandleSpecialURL for that, put your HTMl-Code in.

Or another way: Perhaps the better on… Use a db like mysql or sqlite with xojo. Write your frontendcode in PHP or something like that and use the same db.

If you want your frontend to be useable offline, the first way is yours. In xojo you have use the same Javascript like in the HTML-pages to read and write data.

A I said, it is very easy. There is a “dictionary” offered by the browser. Websites could read an write to that dictionary.
If you want to read an write to it with xojo, you have to send Javascriptcode to the client and talk to it just like you do it on “normal” websites.

So, If you want to write Data from Xojo to the Users Indexeddb you have to create the Javascriptcode in Xojo, send it to the browser and tell him to execute it.

btw. If offline useability is your goal, I wouldn’t like to do it with xojo.
Then I would use Xojo for the Backend and deliver the frontend with php.