views:

348

answers:

2

I have just learned how to use the SQLite database for local storage in a Webkit web browser (e.g. Google Chrome or Apple Safari) using the Javascript API. For example the "Sticky Notes" application.

However, I know that SQLite has a function called sqlite_create_function() that lets you add custom functions to your instance of SQLite on the fly which can then be used inside SQL queries. This function is described at sqlite.org.

I also know that you can call an equivalent of this API in Ruby as described here.

QUESTION: Can anybody show me how to do this in Javascript - i.e. write a custom function in Javascript that can be bound into the SQLite database at run time to be called by the SQLite engine, and all inside a Webkit browser?

A: 

From surfing the web, it seems like Apple is the only company offering any kind of documentation of the SQLite interface through Webkit. It is at apsw.googlecode.com.

In this document they show how to use the Javascript API to open & close databases, run queries, and manipulate results. However, there is no documentation on the Javascript equivalent of sqlite3_create_function. However, I sent a question to them about this and hope to get an answer.

Jay Godse
A: 

Hi, I want to develop a webpage which can read .sqlite file using JavaScript. So could you please tell me how do you use the SQLite database for local storage in a Webkit web browser (e.g. Google Chrome or Apple Safari) using the Javascript API. Thank you very much.

Jacky
@Jacky - This is a question and not an answer. It also does not answer my question. You should ask this under "Questions" in stackoverflow.com.
Jay Godse