dbcli / dbcli/mssql-cli

Having access to raw results of the query would be handy

Offen
#532 3 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
1.4k
Forks
191
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

This might be a duplicate of #231, but that was closed as fixed referencing [non-interactive output options](https://github.com/dbcli/mssql-cli/blob/master/doc/usage_guide.md#outputting-a-query-execution-in-non-interactive-mode). However that only talks about ways running in non-interactive mode and options to either send the results to file on standard out. That only gets us half the way there. Doing so still includes text in the result does not come from the query.

For example

`mssql-cli -S *** -U *** -P *** -Q "SET NOCOUNT ON; SELECT name FROM sys.databases"`

Yields this

```
Commands completed successfully.
+------------------------------------------+
| name |
|------------------------------------------|
| master |
| tempdb |
| model |
| msdb |
| Azurite_Blob |
| Mps_Configuration |
| Mps_653f5e5a-3fbb-44be-9e61-be90630a7187 |
+------------------------------------------+
Commands completed successfully.
```

While correct, that make consuming this output more difficult. Ideally there would an option so that the above query would yield this output
```
master
tempdb
model
msdb
Azurite_Blob
Mps_Configuration
Mps_653f5e5a-3fbb-44be-9e61-be90630a7187
```

My example may be an over simplification, newlines may not always be the best delimiter :smile:. So it may be handy to provide options to return the results in a standard format, here are a few that folks might find handy.
csv, tsv, json, yaml, xml, raw text

Most of the power of many command line tool does not come from running the tool in isolation, but instead comes from being able to combine it with other command line tools.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Lies die vorhandenen Optionen für nicht-interaktive Ausgaben in doc/usage_guide.md und führe dann den Beispielbefehl aus dem Issue erneut aus, um zu prüfen, welcher Statustext und welche Tabellenformatierung ausgegeben werden. Definiere das gewünschte Verhalten für maschinenlesbare Ausgaben und die Formatoptionen; der Abschluss soll durch Abfrageergebnisse gezeigt werden, die ohne zusätzlichen Text verarbeitet werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, sql
Bereich
cli, databases
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.