Custom "Export grid data"

daviid's profile image daviid posted 12 months ago in General Permalink

Could we have the ability to have custom "Export grid data" options? We have PHP Array, but what if I need Python Dictionary, or JSON with column names?

We could have this allowing plugins, some kind of pseudocode with placeholders where we can add an output format for each row using printf (Not sure how HeidiSQL is made)

Before={Before Rows}
Row={Each Row}
After={After Rows}

Example of current JSON output:

Before={\n\t"table": "TABLENAME",\n\t"rows":\n\t[\n
Row=[\n\t\t\t"COLUMN_A",\n\t\t\t"COLUMN_B"\n\t\t]
After=,\n\t]\n}

or

Before={
    "table": "TablaDesconocida",
    "rows":
    [
Row=        [
            "12100016",
            "Rtdos negativos ejercicio 2016"
        ],
After=  ]
}

I won't claim to know exactly how to implement this, just an idea I had.

ansgar's profile image ansgar posted 12 months ago Permalink

Interesting idea. Indeed I could outsource these snippets into an .ini file:

[Excel CSV]
Header=...
Footer=...
RowPreamble=...
RowEpilogue=...
FieldEncloser="
FieldSepararor=,
FieldEscaper=\
FieldEscaperOn="\%
LineTerminator=#13#10

In practice I already see there are quite a few things which are probably impossible to be handled with such a template. For instance special XML attributes for hex values.

In many cases you could also just export JSON and convert to the desired target format.

Please login to leave a reply, or register at first.