Can't grab data if not signed in to a scope

Viewed 37

I have the following query I ran with surrealdb:

DEFINE TABLE school SCHEMAFULL
  PERMISSIONS
    FOR select WHERE true;

DEFINE FIELD name ON TABLE school TYPE string ASSERT is::ascii($value);
DEFINE INDEX name ON TABLE school COLUMNS name UNIQUE;

But whenever I use the surrealdb.js library without calling signin/signup, when I try to query it, it returns nothing.

import Surreal from 'surrealdb.js';

const db = new Surreal('http://127.0.0.1:8000/rpc');

await db.use("test", "test");
console.log(await db.query("SELECT * FROM school")); // {} -- thats weird!
0 Answers
Related