You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to sqlx, hope somebody can help with this simple question:
I am trying to write a Sql2Csv tool, to accept a connstringstring and a select sql statement, and output a CSV file.
I can connect to db, get the cursor, get the row. But I can't convert the row into string. Can't convert the column value to string to be accurate.
All the examples defined a model class, i.e., I need to know the column data type at compile type. But I really don't care the datatype, I just want to print every column value of each row to the standard output. Somehow it seems almost impossible in sqlx.
Who can help with some sample code to print a sqlx row?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am new to sqlx, hope somebody can help with this simple question:
I am trying to write a Sql2Csv tool, to accept a connstringstring and a select sql statement, and output a CSV file.
I can connect to db, get the cursor, get the row. But I can't convert the row into string. Can't convert the column value to string to be accurate.
All the examples defined a model class, i.e., I need to know the column data type at compile type. But I really don't care the datatype, I just want to print every column value of each row to the standard output. Somehow it seems almost impossible in sqlx.
Who can help with some sample code to print a sqlx row?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions