/* Returns the name of an equivalent lua type for a SQL type.  */
static const char* sqltypetolua(const SQLSMALLINT type)
/* Returns the name of an equivalent lua type for a SQL type.  */
static const char* sqltypetolua(const SQLSMALLINT type)
{
        case SQL_UNKNOWN_TYPE: case SQL_CHAR: case SQL_VARCHAR: 
        case SQL_TYPE_DATE: case SQL_TYPE_TIME: case SQL_TYPE_TIMESTAMP: 
        case SQL_DATE: case SQL_INTERVAL: case SQL_TIMESTAMP: 
        case SQL_LONGVARCHAR:
            return "string";
        case SQL_BIGINT: case SQL_TINYINT: case SQL_NUMERIC: 
        case SQL_DECIMAL: case SQL_INTEGER: case SQL_SMALLINT: 
        case SQL_FLOAT: case SQL_REAL: case SQL_DOUBLE:
            return "number";
        case SQL_BINARY: case SQL_VARBINARY: case SQL_LONGVARBINARY:
            return "binary";
        case SQL_BIT:
            return "boolean";
        default:
            assert(0);
            return NULL;
    }
}