Skip to content

Commit 465a187

Browse files
committed
fix(cli): remove useless commands on connect
- removed list databases and list tables for autocompletion
1 parent 21fa205 commit 465a187

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

cli/sqlc.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -502,16 +502,12 @@ func main() {
502502
prompt = "\\u@\\H:\\p/\\d > "
503503

504504
refreshDB := false
505-
if parameter.Database != "" {
506-
refreshDB = true
507-
}
508505

509506
Loop:
510507
for {
511508
out.Flush()
512509
if refreshDB {
513510
db.Database, _ = db.GetDatabase()
514-
go func() { dynamic_tokens = db.GetAutocompleteTokens() }() // Update the dynamic tokens in the background...
515511
}
516512

517513
renderdPrompt := prompt

connection.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,17 @@ func connectionCommands(config SQCloudConfig) (string, []interface{}) {
463463
buffer += noblobCommand(config.NoBlob)
464464
}
465465

466-
buffer += maxdataCommand(config.MaxData)
466+
if config.MaxData > 0 {
467+
buffer += maxdataCommand(config.MaxData)
468+
}
467469

468-
buffer += maxrowsCommand(config.MaxRows)
470+
if config.MaxRows > 0 {
471+
buffer += maxrowsCommand(config.MaxRows)
472+
}
469473

470-
buffer += maxrowsetCommand(config.MaxRowset)
474+
if config.MaxRowset > 0 {
475+
buffer += maxrowsetCommand(config.MaxRowset)
476+
}
471477

472478
return buffer, args
473479
}

0 commit comments

Comments
 (0)