Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
9619b1c3
Commit
9619b1c3
authored
5 months ago
by
Вартан Бабаян
Browse files
Options
Downloads
Patches
Plain Diff
fix: treating backslashed command in picodata admin/connect
parent
57451ee6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1390
add EOF as second delimiter along with ;
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cli/admin.rs
+6
-6
6 additions, 6 deletions
src/cli/admin.rs
src/cli/connect.rs
+4
-4
4 additions, 4 deletions
src/cli/connect.rs
src/cli/console.rs
+24
-12
24 additions, 12 deletions
src/cli/console.rs
with
34 additions
and
22 deletions
src/cli/admin.rs
+
6
−
6
View file @
9619b1c3
...
...
@@ -254,12 +254,12 @@ fn admin_repl(args: args::Admin) -> Result<(), ReplError> {
const
HELP_MESSAGE
:
&
'static
str
=
"
Available backslash commands:
\\
e
;
Open the editor specified by the EDITOR environment variable
\\
help
;
Show this screen
\\
sql
;
Switch console language to SQL (default)
\\
lua
;
Switch console language to Lua (deprecated)
\\
set delimiter shiny-delimiter
;
Set console delimiter to 'shiny-delimiter'
\\
set delimiter default
;
Reset console delimiter to default (;)
\\
e Open the editor specified by the EDITOR environment variable
\\
help Show this screen
\\
sql Switch console language to SQL (default)
\\
lua Switch console language to Lua (deprecated)
\\
set delimiter shiny-delimiter Set console delimiter to 'shiny-delimiter'
\\
set delimiter default Reset console delimiter to default (;)
Available hotkeys:
Enter Submit the request
...
...
This diff is collapsed.
Click to expand it.
src/cli/connect.rs
+
4
−
4
View file @
9619b1c3
...
...
@@ -217,10 +217,10 @@ fn sql_repl(args: args::Connect) -> Result<(), ReplError> {
const
HELP_MESSAGE
:
&
'static
str
=
"
Available backslash commands:
\\
e
;
Open the editor specified by the EDITOR environment variable
\\
help
;
Show this screen
\\
set delimiter shiny-delimiter
;
Set console delimiter to 'shiny-delimiter'
\\
set delimiter default
;
Reset console delimiter to default (;)
\\
e Open the editor specified by the EDITOR environment variable
\\
help Show this screen
\\
set delimiter shiny-delimiter Set console delimiter to 'shiny-delimiter'
\\
set delimiter default Reset console delimiter to default (;)
Available hotkeys:
Enter Submit the request
...
...
This diff is collapsed.
Click to expand it.
src/cli/console.rs
+
24
−
12
View file @
9619b1c3
...
...
@@ -210,18 +210,30 @@ impl<T: Helper> Console<T> {
match
readline
{
Ok
(
line
)
=>
{
self
.uncompleted_statement
+=
&
line
;
if
let
Some
(
ref
delimiter
)
=
self
.delimiter
{
while
let
Some
((
separated_part
,
tail
))
=
self
.uncompleted_statement
.split_once
(
delimiter
)
{
self
.separated_statements
.push_back
(
separated_part
.into
());
self
.uncompleted_statement
=
tail
.into
();
if
line
.starts_with
(
Self
::
SPECIAL_COMMAND_PREFIX
)
{
let
processed
=
self
.handle_special_command
(
&
line
)
?
;
match
processed
{
ControlFlow
::
Continue
(
_
)
=>
continue
,
ControlFlow
::
Break
(
command
)
=>
{
return
self
.update_history
(
command
)
}
}
}
else
{
self
.uncompleted_statement
+=
&
line
;
if
let
Some
(
ref
delimiter
)
=
self
.delimiter
{
while
let
Some
((
separated_part
,
tail
))
=
self
.uncompleted_statement
.split_once
(
delimiter
)
{
self
.separated_statements
.push_back
(
separated_part
.into
());
self
.uncompleted_statement
=
tail
.into
();
}
}
else
{
self
.separated_statements
.push_back
(
std
::
mem
::
take
(
&
mut
self
.uncompleted_statement
));
}
}
else
{
self
.separated_statements
.push_back
(
std
::
mem
::
take
(
&
mut
self
.uncompleted_statement
));
}
}
Err
(
ReadlineError
::
Interrupted
)
=>
{
...
...
@@ -266,7 +278,7 @@ impl<T: Helper> Console<T> {
/// Prints information about connection and help hint
pub
fn
greet
(
&
self
,
connection_info
:
&
str
)
{
self
.write
(
connection_info
);
self
.write
(
"type '
\\
help
;
' for interactive help"
);
self
.write
(
"type '
\\
help' for interactive help"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment