Is there any non-textual interface for MySQL?

I have a MySQL query that returns a result with a single column of integers. Is there a way to get the MySQL API to pass this as integers, and not as ASCII text? In this regard, there is a way to force MySQL to execute / any / API material other than ASCII text. I think this will save a little time in sprintf / sscanf or whatever else is used, as well as in the bandwidth.

+4
source share
1 answer

You are probably out of luck, to be honest. Looking at the MySQL C API ( http://dev.mysql.com/doc/refman/5.0/en/mysql-fetch-row.html , http://dev.mysql.com/doc/refman/5.0/en/ c-api-datatypes.html , look at MYSQL_ROW), there seems to be no mechanism to return data to its actual type ... the joy of using structures, I think.

You can always implement a wrapper that checks an attribute of type MYSQL_ROW ( http://dev.mysql.com/doc/refman/5.0/en/c-api-datatypes.html ) and returns a C connection, but maybe bad advice ; do not do that.

+1
source

Source: https://habr.com/ru/post/1276337/


All Articles