Storage

  • Revision slug: Talk:Storage
  • Revision title: Storage
  • Revision id: 134138
  • Created:
  • Creator: Jeongkyu
  • Is current revision? No
  • Comment /* 'Working around locking problems' section is confusing */

Revision Content

With regards to the way the results from queries are returned, wouldn't it be better (and more logical) to mimmick the PHP way of doing this, whereby results are stored in a 2D array/object which is returned? This is, at least, the way I would expect the behaviour to be in JavaScript, rather than a more iterative approach.

I'm also not really sure what the benefit is to having several APIs for running queries. This makes it extremely difficult to create (for example) an SQLite console window in XULRunner, which was a recent experiment of mine. Is it plausible in any way to have a generic "run query and get results, if any" API as a replacement for or in addition to the current APIs?

--BenBasson 15:37, 2 August 2006 (PDT)

Do we need mozIStorageDataSet.idl anymore?

I saw mosIStorageDataSet.idl in the Firefox 2.0 beta 1 source. As far as I can see that interface is not used. Should it be dropped?

-- LeRoyK 14 August 2006

Maybe

The two previous questions are related. I think mozIStorageDataSet was there for returning a big array. It's currently unused, but perhaps we should add this capability. I'm not totally sure what Vlad had in mind for this.

-- Brett Wilson 15 August 2006

Closing Open connection

I don't see a close method to close database connection in mozIStorageConnection interface. Is statement.reset() enough for freeing up the connection ?

-- Saravana 02 December 2006

I like example code for APIs and I do not see any

This is a nice "Song Play List" example

I uploaded an annotated example to with all files zipped in TTRW2.zip. Its a "Hello World" for extension developers new to MOZSTORAGE. See the list of uploaded files. Gary.johnson.53 18 April 2007


'Working around locking problems' section is confusing

The section is confusing to me because it mentions the way (1) and (2), which don't exist in the current document. It seems that the section needs to be revised with the information in the below paragraph, which I found from the old version.

SQLite Statements and Connections

Each SQLite can support only one active statement. This means that if you need to read the results of a query, and then do further queries based on each row, you have two options:
1. Read the rows from the first query completely, and then run secondary queries to fill in that data afterwards.
2. Create a second database handle, and perform secondary queries using that database handle while reading rows from the first statement.

This restriction might be lifted once SQLite supports proper cursors.

-- Jeongkyu 27 January 2008

Revision Source

<p>With regards to the way the results from queries are returned, wouldn't it be better (and more logical) to mimmick the PHP way of doing this, whereby results are stored in a 2D array/object which is returned? This is, at least, the way I would expect the behaviour to be in JavaScript, rather than a more iterative approach.
</p><p>I'm also not really sure what the benefit is to having several APIs for running queries. This makes it extremely difficult to create (for example) an SQLite console window in XULRunner, which was a recent experiment of mine. Is it plausible in any way to have a generic "run query and get results, if any" API as a replacement for or in addition to the current APIs?
</p><p>--<a href="User:BenBasson">BenBasson</a> 15:37, 2 August 2006 (PDT)
</p>
<h3 name="Do_we_need_mozIStorageDataSet.idl_anymore.3F"> Do we need mozIStorageDataSet.idl anymore? </h3>
<p>I saw mosIStorageDataSet.idl in the Firefox 2.0 beta 1 source. As far as I can see that interface is not used. Should it be dropped?
</p><p>-- LeRoyK 14 August 2006
</p>
<h3 name="Maybe"> Maybe </h3>
<p>The two previous questions are related. I think mozIStorageDataSet was there for returning a big array. It's currently unused, but perhaps we should add this capability. I'm not totally sure what Vlad had in mind for this.
</p><p>-- Brett Wilson 15 August 2006
</p>
<h3 name="Closing_Open_connection"> Closing Open connection </h3>
<p>I don't see a close method to close database connection in mozIStorageConnection interface. Is statement.reset() enough for freeing up the connection ?
</p><p>-- Saravana 02 December 2006
</p>
<h3 name="I_like_example_code_for_APIs_and_I_do_not_see_any"> I like example code for APIs and I do not see any </h3>
<p>This is a nice <a class="external" href="http://simon-cozens.org/programmer/articles/xul-storage.pod">"Song Play List" </a> example
</p><p>I uploaded an annotated example to with all files zipped in TTRW2.zip. Its a "Hello World" for extension developers new to MOZSTORAGE. See the list of uploaded files.
Gary.johnson.53 18 April 2007
</p><p><br>
</p>
<h3 name=".27Working_around_locking_problems.27_section_is_confusing"> 'Working around locking problems' section is confusing </h3>
<p>The section is confusing to me because it mentions the way (1) and (2), which don't exist in the current document. It seems that the section needs to be revised with the information in the below paragraph, which I found from the old version.
</p>
<blockquote>
<p>SQLite Statements and Connections</p>
<p>Each SQLite can support only one active statement. This means that if you need to read the results of a query, and then do further queries based on each row, you have two options:<br>
1. Read the rows from the first query completely, and then run secondary queries to fill in that data afterwards.<br>
2. Create a second database handle, and perform secondary queries using that database handle while reading rows from the first statement.</p>
<p>This restriction might be lifted once SQLite supports proper cursors.</p>
</blockquote>
<p>-- Jeongkyu 27 January 2008
</p>
Revert to this revision