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

Feature: Make --ns and --db arguments optional in command-line REPL #34

Closed
2 tasks done
tobiemh opened this issue Aug 13, 2022 · 6 comments
Closed
2 tasks done
Assignees
Labels
feature New feature or request good first issue Good for newcomers

Comments

@tobiemh
Copy link
Member

tobiemh commented Aug 13, 2022

Is your feature request related to a problem?

The original points for this issue can be seen in #32.

If SurrealDB is started for the first time, or if no Namespace or Database exists yet, then it doesn't make sense to specify a Namespace or Database using the --ns or --db arguments when running the command-line REPL with surreal sql.

Describe the solution

The --ns and --db arguments should be optional.

Alternative methods

Currently the arguments are required.

SurrealDB version

surreal 1.0.0-beta.6 for macos on aarch64

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tobiemh tobiemh added the feature New feature or request label Aug 13, 2022
@tobiemh tobiemh self-assigned this Aug 13, 2022
@tobiemh tobiemh added the good first issue Good for newcomers label Aug 13, 2022
@clawcastle
Copy link
Contributor

I would love to have a go at helping with this one, if no one else is currently working on it!

@clawcastle
Copy link
Contributor

Should the arguments only be optional for the sql subcommand, or also for the import and export subcommands?

@tobiemh
Copy link
Member Author

tobiemh commented Aug 23, 2022

Hi @sunero4 awesome news! The import and export subcommands will always need to have the argument supplied. It's just the sql subcommand which should be optional (because you can specify a database using the USE statement once you have connected!

@clawcastle
Copy link
Contributor

@tobiemh Okay, that makes sense! I'll take a look at this some time after work today.

@clawcastle
Copy link
Contributor

@tobiemh I'm having some trouble running the project on my machine (Ubuntu 20.04 LTS in WSL). I get a CMake error when trying to build the dependency grpcio-sys:

--- stderr
  CMake Warning at cmake/protobuf.cmake:51 (message):
    gRPC_PROTOBUF_PROVIDER is "module" but PROTOBUF_ROOT_DIR is wrong
  Call Stack (most recent call first):
    CMakeLists.txt:254 (include)


  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS


  make: warning: -j8 forced in submake: resetting jobserver mode.
  /home/alk/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.8.1/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function ‘void absl::lts_2020_09_23::synchronization_internal::GraphCycles::RemoveNode(void*)’:
  /home/alk/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.8.1/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: ‘numeric_limits’ is not a member of ‘std’
    451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
        |                          ^~~~~~~~~~~~~~
  /home/alk/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.8.1/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before ‘>’ token
    451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
        |                                                 ^
  /home/alk/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.8.1/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: ‘::max’ has not been declared; did you mean ‘std::max’?
    451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
        |                                                    ^~~
        |                                                    std::max
  In file included from /usr/include/c++/11/algorithm:62,
                   from /home/alk/.cargo/registry/src/github.com-1ecc6299db9ec823/grpcio-sys-0.8.1/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38:
  /usr/include/c++/11/bits/stl_algo.h:3467:5: note: ‘std::max’ declared here
   3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
        |     ^~~
  make[3]: *** [third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:63: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
  make[2]: *** [CMakeFiles/Makefile2:3321: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [CMakeFiles/Makefile2:990: CMakeFiles/grpc.dir/rule] Error 2
  make: *** [Makefile:242: grpc] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2

@clawcastle
Copy link
Contributor

Just saw the comments on #58 about disabling kv-tikv in cargo.toml - I will try that today :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants