Code Monkey home page Code Monkey logo

Comments (4)

Lilit0x avatar Lilit0x commented on June 10, 2024

Hi @waynexia , I am interested in working on this, but I'll like some clarifications.

  • How is this different from --attach? Because I see it commented out in the code here
  • The repl.rs file does the heavy lifting of parsing the texts and lines and I can also see that there is a USE DATABASE command. Should this also be part of this new client?

Those are the question I have for now, I will add more as I continue to go through the code.
Thanks

from greptimedb.

waynexia avatar waynexia commented on June 10, 2024

Hi @Lilit0x!

How is this different from --attach? Because I see it commented out in the code here

--attach is primarily for connecting to "datanode" and for debug purposes. While this one is only a gRPC client, and can only connect to one "frontend" (in case you need, this doc explains what datanode and frontend are). This cli client is mainly for two things:

  • Provide a built-in, simple client with the binary greptime, so we don't need another client (like psql or mysql) for some simple operations.
  • Provide an interactive interface for our SQL dialect. It's slightly different from pg and MySQL.

The repl.rs file does the heavy lifting of parsing the texts and lines and I can also see that there is a USE DATABASE command. Should this also be part of this new client?

We don't need to do this, at least for now. At this stage, this client only needs to support some fundamental functionalities. Others like switching database or client-side states are not on the list.

For setting up database, you can take cli export as an example. It accept --database from cli arg, and parses it to catalog and schema.

from greptimedb.

Lilit0x avatar Lilit0x commented on June 10, 2024

Thanks for expatiating, it should be pretty easy. Below is a rough outline of how I'll implement it.

  • Basic arguments:

    • host
    • port
    • database
    • user(this will come in the second stage after basic implementation)
    • file(sql file to run. this will also come after basic implementation)
  • Initiate a Client by combining the host and port into an address (since we're using psql as a model is why I separate the host and port as different args) and create a QueryEngine.

  • Pass these to an instance of the Repl struct.

  • Lastly, displaying the results.

from greptimedb.

waynexia avatar waynexia commented on June 10, 2024

Looks good. If the input file is not provided we should start an interactive prompt interface like before.

from greptimedb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.