SQLITE + CHROME / SAFARI: "not authorized" ERROR

I am trying to execute a bulk transaction using SQLITE on CHROME (and SAFARI).

I am doing this with javascript, so this is what I have:

==================================================== ============

query = "BEGIN TRANSACTION;"

query + = "INSERT INTO school (name) VALUES ('School 1');

query + = "COMMIT TRANSACTION;"

db.executeSql (request);

==================================================== ============

When I run this, I get the error message: NOT AUTHORIZED.

This only happens when I use the keywords "BEGIN" or "BEGIN TRANSACTION" or "COMMIT" or "END TRANSACTION".

I searched on the Internet, and the only thing I can think of so far is the error message “NOT AUTHORIZED” means that this function is not supported.

Does anyone know more about this?

Thank,

Nick

+3
source share
1 answer

Indeed, you do not need the keywords BEGIN TRANSACTION, COMMIT, and END in your SQL queries.

I also have this "not authorized (code 1)" error when I check my code with Safari in private browsing mode (Safari-> Private Browsing menu). When it is turned off, it works fine.

DaveOnCode also saw this behavior.

+2
source

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


All Articles