concept of TMS Webcore indexeddb ?

Hi ,

I am trying to use indexeddb but not sure where to start , 
could you please help to clarify the following , 
1. is there some documents regarding about how to use it ?
2. how do we manage db versioning , when we modify our db structures ?
3. what is the best way to initialize our table structure in our database
    let say we have more than 50 tables and how can we avoid of creating the 
    table fields one by one using field editors ?
4. Are we able to get the data by exporting as JSON from TWEbClientDataset ?


At this moment doc is not yet ready. It is in beta and we are working on this. As soon as doc & sample is ready,it will be integrated in the distribution.

Hi , thanks for the new added indexeddb example , here are some of my questions after checking out the example,

1. why IndexedDBClientDataSet.Indexes.Add('DD','due_date',[ixPrimary]); have to 
   add again, isn't it IndexedDBClientDataSet.AddIDBIndex('ByDate', 'due_date'); already 
   added the index ? 

    is IndexedDBClientDataSet.IDBActiveIndex := 'ByDate'; same as
    IndexedDBClientDataSet.ActiveIndex := 'DD'; ?

2. if my indexeddb table was been created previously by JS, or some other JS library ,
    i need to add the fields one by one like IndexedDBClientDataSet.FieldDefs.Add('status',ftString); ?

3. the IndexedDBClientDataSet , possible to open the table using the name of the table directly like
   WebClientDataset , which we do not need to force to create the fieldDefs one by one ?
  1. There is a difference between the IndexedDB indexes and Pascal dataset index. 
    2. For the Pascal dataset, indeed fields need to be created
    3. At this moment, FieldDefs always need to be created for the dataset

Hi , 

1. not sure i got what u try to explain, as i showed that the already added the index ,
IndexedDBClientDataSet.AddIDBIndex('ByDate', 'due_date');

but how come , Hi , 
1. not sure i got what u try to explain, as i showed that the already added the index ,
IndexedDBClientDataSet.AddIDBIndex('ByDate', 'due_date');

but how come , IndexedDBClientDataSet.Indexes.Add('DD','due_date',[ixPrimary]); have to add one more time, do u mean that in the for all indexeddb dataset , if we need to use the indexes , we need to create twice, one is when we actually create them physically ,another is dataset, is when we need to use it ,

so one is for calling the indexeddb component to create the physical dataset 
another is for creating to be used by the UI ?

Hi , i have some more questions regarding about the indexeddb , have been waiting for it as one of my function for my webapp is required to use indexeddb,

1. is there a way to manage the versioning of indexeddb using the component ?
    let say , i added new fields and need to manage the version, how can i do that ?

2. if i have already created the indexeddb table in my JS , how do i open the table ?
    i can see the database name , table in my chrome developer console , application tab,
   under storage section , how do i use the component to point to the existing 
   storage / tables and make use of the data , those that stored .

please advice.
  1. At this moment there is at component level no versioning support
    2. Map an TWebIndexedDBClientDataSet on it and you can start using it (see the IndexedDB demo under Demo\Basics\IndexedDB

HI , it is not so straight forward ,until today ,i still cannot get the indexeddb dataset component works,

let me give u an example , i use JS script to created the indexeddb table ,
     queue_log : "&id,res_id,temp_id,process_type,model_name"

and when my project is running , i can view the queue_log table in the chrome dev console , which
has the table queue_log
with 3 key (key path : 'model_name') primary key( key path: "id" )
                 (key path : 'res_id') primary key( key path: "id" )
                 (key path : 'process_type') primary key( key path: "id" )

and i have other fields , let say is field1string , field2date , not part of the index but normal
fields , what should i do exactly in order to map into the indexeddb component , to use
it the indexeddbDataset component .

thanks .

You create a TWebIndexedDBClientDataSet and add to FieldDefs the fields you want to connect to.
This is demonstrated in the IndexedDB demo under Demo\Basics\IndexedDB

Hi Bruno ,

Can i find out if i wish to add a primary key ID but not need to auto incremental , how to do that ?

Did you set TWebIndexedDBClientDataSet.IDBAutoIncrement = false?

why i keep facing this ,

IndexedDB: Internal error, DoGetData entry with these conditions not possible.
IndexedDB Warning: AddIndex commands ignored for existing database.