Hi,
I need some help
I have a mysql db on google. I can see it in the database tab.
But access is fixed to Admin, I can not change that.
I can query my db as a Admin using the preview view.
But this is not possible when I deploy in test.
I get the follwoing:
âError: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.â
I can fetch my data as Admin but not as user. I tried by moving the query call to the backend and adding suppressAuth. But that did not help.
Any ideas about how to proceed ??
code below:
I have moved my query to a db.jsw in backend
db.jsw
import wixData from âwix-dataâ ;
export function searchAdress_back () {
return wixData . query ( âmysql/search_viewâ )
. limit ( 2000 )
. find ({ suppressAuth : true })
. then ( ( results ) => {
return results ;
});
}
Mainpage main.js
import { searchAdress_back } from âbackend/dbâ ;
function searchAdress ( params ) {
let adress ;
adress = $w ( â#addressInput1â ). value ;
let lat = adress.location.latitude ;
let long = adress.location.longitude ;
// gethold of db data and querry
let db ;
filteredResult = ;
tableSet = ;
searchAdress_back ()
. then ( ( results )=> {
db = results ;
console.log(db);
âŚ
âŚ
âŚ
}). catch ( e => {
console . log ( âError query:â )
console . log ( e );
});
}
Running this code gives me the permission error in the header. âUnable to handle the request. Contact the site administratorâ Any suggestions on how to gives access / query the database for a normal user?