Search code examples
wakanda

wakanda database query error when testing in bootstrap.js


I created a new project in wakanda studio 1.1.3, then I created a model called Users with one attribute email of string type.

I passed on a query in my bootstrap.js to check if i am getting any value from the database.

The query command is the following

ds.Users.query({select: "email"});

The model is global access

When i run this is my console i am getting an error

"Some error occurred while parsing: 503 - Service Unavailable body { margin: 0px; padding: 0px; font: 90% "Lucida Grande", Lucida, Verdana, sans-serif; } div#title { background-color: #2c4b79; padding: 15px 15px 15px 20px; margin: 0px; } div#message { padding: 20px; } div#details { padding: 10px; } h2 { color: #fff; font-size: 1.3em; margin: 0; padding: 0; } p { padding: 0px; margin: 0px; }

503 - Service Unavailable

"

Can anyone help in this issue


Solution

  • Don't use your bootstrap.js file for testing purposes. Create a new file that is not bootstrapped (ex. test.js, serverside.js, ...) and run (Run Button) a valid query (http://doc.wakanda.org/home2.en.html#/Wakanda-Server-Side-Concepts/Programming-in-Wakanda-Server/Queries-and-Finds.300-720609.en.html) in that file. You will then see the output in the output area:

    Query Example:

    ds.Users.all();
    
    ds.Users.query('ID > 0');
    
    ds.Users.query('ID > :1', 0);
    

    Inside Wakanda studio:

    enter image description here