Search code examples
wakanda

Wakanda MySQL TEXT data type


Can't get data from MySQL field with data type "text". It just return empty value, for other string type (char, varchar) it's returning a value as expected.

Any help would be highly appreciated, Thanks.


Solution

  • We've dug into this, and indeed there is a bug on the Pro Connector:
    - The Text type is not properly managed

    We' ll fix this asap.

    In the meantime, you could use the following workaround (it's not perfect however) -


    Workaround:

    To manage specifically the text type, for now you could use the Mysql Wakanda driver. When using it text type are handled as blob type you might parse as string.

    var sql = require('waf-sql');
    var params = {
       hostname: '192.168.XX.XX',
       port: xx,
       user: 'xx',
       password: 'xx',
       database: 'xx',
       ssl: false,
       dbType: 'mysql'
    };
    var session = sql.connect(parms);
    var query = "select txt from TextType";
    var res = session.execute(query);
    var rows = res.getAllRows();
    rows[0].txt.toString()
    

    It's not as advanced as the Pro Connector but it allows you to retrieve your elements.


    EDIT :

    The bug has been fixed and will be included in the next major Wakanda version. I'll keep u posted here when the release date is defined.

    BR
    Fred
    Wakanda Team