strongloop / strong-oracle

Deprecated: Node.js Driver for Oracle databases (Use https://github.com/oracle/node-oracledb instead)
Other
45 stars 18 forks source link

option getColumnMetaData and result.columnMetaData #20

Closed ericwaldheim closed 9 years ago

ericwaldheim commented 9 years ago

This pull request adds an options argument to connection.execute as an optional 3rd argument. This allows specification of {getColumnMetaData:true} as the options argument.

Regression tests added. Existing tests pass. I will modify the documentation here if/when API is nailed down. (And then there's the test suite issue I mentioned here: https://github.com/strongloop/strong-oracle/issues/19#issuecomment-71057152)

Current API example:

    connection.execute(
        "SELECT * FROM person", [], {getColumnMetaData:true},
        function(err, results) {
            if ( err ) { ... } 
            // results.columnMetaData = [ { name: 'ID', type: 4 }, { name: 'NAME', type: 3 } ]
            connection.close();
        }
    );

Thank you