2

I have a few questions that I can't seem to get workable answers to after hanging ten on the internet for an hour and a half, so I figured I would ask them directly.

I want to incorporate some prepared statements into a JavaScript application that is already using SQLite. As far as I understand, if I'm not using prepared statements, my app is suffering unnecessarily. (Correct me if I am wrong.)

Here's the big stumper though, is this something that works in JavaScript. I see very little on the internet that contains SQLite and JavaScript, and even less about JavaScript and prepared statements. I was hoping to use this to speed up the app and validate my statements for troublesome characters such as ". (I'm already validating those, but knocking out an unnecessary validation function would be nice.)

If nothing else, a nice link or comment about what other characters might meddle with me would be helpful. That seems to be hard to find as well.

McPhelpsius
  • 253
  • 1
  • 4
  • 16
  • There was a brief dalliance with SQlite and Javascript, but it was abandoned in favour of indexedDB. SQL systems are now the province of server-side code. Are you sure that your Javascript application is actually using SQLite? –  Jul 02 '13 at 20:49
  • I'm certain. I sync up from a local database for offline until online sync up to the main database is available. Disconnected SQL on an iPad – McPhelpsius Jul 02 '13 at 20:56
  • I can't help, then. I'm not surprised you're having trouble - I've not come across that setup before. –  Jul 02 '13 at 20:58
  • No worries. It's a unique little fart, and we were just looking at boosting it, simplifying, etc. 2nd or 3rd iteration, so it's more exploratory at this point. – McPhelpsius Jul 02 '13 at 21:00

1 Answers1

1

The JavaScript API for SQLite does not support prepared statements.

The Firefox API for connecting to databases from within chrome (i.e., an add-in), adds an executeCached method which will cache the statement for re-use, but this is not included in the Web SQL Database specification and not available anywhere else.

Samuel Neff
  • 73,278
  • 17
  • 138
  • 182