Skip to content
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

Switch cli::sql to the new API #1561

Merged
merged 1 commit into from Dec 30, 2022
Merged

Switch cli::sql to the new API #1561

merged 1 commit into from Dec 30, 2022

Conversation

rushmorem
Copy link
Collaborator

@rushmorem rushmorem commented Dec 30, 2022

What is the motivation?

We recently introduced a new API for surrealdb. This is the first commit in a series of commits to update the server to use the that API.

What does this change do?

It updates the cli::sql module to the new API.

One positive side-effect of this is that it is now possible to use the REPL without having to spin up a server first. This is because the connection string now allows using any database engine supported by SurrealDB. That includes the embedded ones. This means that one can now run

surreal sql --conn mem:// --ns test --db test

or just

surreal sql --conn mem://

which will embedded an in-memory database and run queries against that.

Another positive side effect is that the REPL now fully supports LET and USE statements regardless of the database engine you are using.

What is your testing strategy?

I ran

cargo run --no-default-features -F storage-mem -- sql --conn mem:// --ns test --db test

and tested running some queries.

Is this related to any issues?

Have you read the Contributing Guidelines?

@tobiemh tobiemh merged commit 7c199ff into surrealdb:main Dec 30, 2022
@rushmorem rushmorem deleted the cli/sql branch December 30, 2022 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants