miniob icon indicating copy to clipboard operation
miniob copied to clipboard

feat: support multiline SQL input in obclient #<573>

Open e-gonzalezz opened this issue 3 months ago • 2 comments

What problem were solved in this pull request?

Previously, obclient did not support multi-line SQL input. When users entered a statement that spanned multiple lines (e.g., CREATE TABLE), the client failed to parse it and returned an error.

Issue Number: close #573

What is changed and how it works?

Enhanced the client input handling logic to buffer input until a terminating semicolon (;) is received. Modified the prompt to match MySQL-style continuation (->) for multi-line queries. Now, users can input SQL statements across multiple lines, and the client will execute them only when complete.

Example before:

miniob > create table t( SQL_SYNTAX > Failed to parse sql

Example after:

miniob > create table t( -> a int, -> b int); SUCCESS

Other information

Tested with CREATE TABLE both single-line and multi-line.

e-gonzalezz avatar Oct 01 '25 19:10 e-gonzalezz

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 01 '25 19:10 CLAassistant

Thanks for your contribution. I left some issues, if you have any questions, please feel free to ask.

hnwyllmm avatar Oct 09 '25 01:10 hnwyllmm