-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Select either namespace or database to use #26
Comments
Encounter the same error. |
I also encountered the same error and solved it this way first create database with surreal cli
surreal start --user $USERNAME --pass $PASSWORD file:database.db --auth then sign in with the namespace and database await db.connect(options.url)
await db.signin({
namespace: 'root',
database: 'root',
username: options.username,
password: options.password,
}) |
Thanks for sharing this possible workaround, haven't had the time to try it out yet, it's also a little inconvenient on deploys, hmm could be able to throw the CLI call into the Dockerfile and then have NodeJS connect to that I suppose 🤔 |
Thank you. The key to the solution for me was the property names |
Hello, folks, I'm a Rust user so that I'd like to try this surrealDb, as it seems awesome.
The thing is, in this test project I'm not using Rust but node (specifically nestJs).
I want to have my db to run locally, but I'm seeming to get an error that I don't know where it comes from, nor what should I do.
Here's my function for connecting to it:
So, when I tried to run a query I got this error
error: [Error: Specify a namespace to use] { code: 'GenericFailure' }
, now in the code above, if I add thisawait this._db.use({ namespace: 'questions', database: });
I get another error:error: [Error: Select either namespace or database to use] { code: 'GenericFailure' }
Thing is, I've already run DEFINE statements using the commands
surreal start --log trace --user root --pass root file://questions.db
surreal sql --conn http://localhost:8000 \ --user root --pass root
DEFINE NS questions
USE NS questions
DEFINE DATABASE dev
, but they didn't seem to work. What am I doing wrong?
The text was updated successfully, but these errors were encountered: