Can we use sql query to acess database in javascript?

can we use sql query to acess database in javascript?
if yes, how? what is syntax of that?

I suggest you go through the developer training video series. You will find your answers there.

1 Like

No you cannot. Executing a SQL query on the client? Holy Moly! That would make the lives of all hackers so blissful. Database intrusion on demand, lmao!

What you can use is frappe.db to access values and set values (on permissions).

There’s get_list, get_value, get_single_value, set_value (The server side helper handles all permissions associated to the query and is safe).

3 Likes