How to write custom SQLite functions in Javascript inside Webkit browser?

I just found out how to use the SQLite database for local storage in a Webkit web browser (like Google Chrome or Apple Safari) using the Javascript API. For example, the Sticky Notes application .

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

I also know that you can name the equivalent of this API in Ruby, as described here .

QUESTION: Can someone show me how to do this in Javascript, that is, write a custom function in Javascript that can be bound to the SQLite database at runtime, which is called by the SQLite engine, and everything inside the Webkit browser?

+3
source share
1 answer

From surfing the Internet, it seems that Apple is the only company offering any documentation on the SQLite interface through Webkit. It is located at apsw.googlecode.com .

, Javascript API , . , Javascript sqlite3_create_function. .

+1

Source: https://habr.com/ru/post/1745738/


All Articles