New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extended metaData #386

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants
@leolmi

leolmi commented Mar 22, 2016

extend metaData items

metaData array now exposes items with more properties:

  • name : field name
  • type : field data type (JS datatype)
  • originalType : field data type (DB datatype)
  • size : DB field size
  • precision : DB field precision
  • scale : DB field scale
  • isNullable : field can be null
connection.execute(
  "... SQL statement ...",
  [],
  function(err, result)
  {
    var columns = _.map(result.metaData, function(c)
    {
      return {
        name: c.name || '',
        type: c.type || '',
        originalType: c.originalType || 'undefined',
        size: c.size || 0,
        precision: c.precision || 0,
        scale: c.scale || 0,
        isNullable: c.isNullable
      };
    });
  });

Signed-off-by: Leonardo Olmi leo.olmi@gmail.com

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Mar 22, 2016

Member

Thank @leolmi. Did you submit your OCA paperwork? Also I should get more formal and request the 'Signed-off-by:' mentioned in that doc.

Member

cjbj commented Mar 22, 2016

Thank @leolmi. Did you submit your OCA paperwork? Also I should get more formal and request the 'Signed-off-by:' mentioned in that doc.

@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Mar 22, 2016

Hi @cjbj, yes, I have already sent the document to oracle-ca_us@oracle.com.

leolmi commented Mar 22, 2016

Hi @cjbj, yes, I have already sent the document to oracle-ca_us@oracle.com.

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Mar 22, 2016

Member

Thank you. They batch up requests so it may take a short while for them to process it.

Member

cjbj commented Mar 22, 2016

Thank you. They batch up requests so it may take a short while for them to process it.

@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Mar 22, 2016

thanks to you, it was a pleasure!

leolmi commented Mar 22, 2016

thanks to you, it was a pleasure!

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Mar 22, 2016

Member

@leolmi can you add the signoff?

Member

cjbj commented Mar 22, 2016

@leolmi can you add the signoff?

@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Mar 23, 2016

what happened? I have to send the OCA again?

leolmi commented Mar 23, 2016

what happened? I have to send the OCA again?

@leolmi leolmi closed this Mar 23, 2016

@cjbj cjbj reopened this Mar 23, 2016

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Mar 23, 2016

Member

@leolmi the OCA may take time if they didn't get back to you.
I was asking about the commit message/description needing a Signed-off-by: Your Name <you@example.org> - see CONTRIBUTING

Member

cjbj commented Mar 23, 2016

@leolmi the OCA may take time if they didn't get back to you.
I was asking about the commit message/description needing a Signed-off-by: Your Name <you@example.org> - see CONTRIBUTING

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Mar 23, 2016

Member

@leolmi we had some discussions. How about:

  1. Adding a new execute() options attribute to turn off metadata gathering. This should improve performance for people who don't want metadata. The default would be to always have metadata; this keeps compatibility.
  2. We feel that creating new numeric constants in lib/oracledb.js would be better than using strings for the DB types.
Member

cjbj commented Mar 23, 2016

@leolmi we had some discussions. How about:

  1. Adding a new execute() options attribute to turn off metadata gathering. This should improve performance for people who don't want metadata. The default would be to always have metadata; this keeps compatibility.
  2. We feel that creating new numeric constants in lib/oracledb.js would be better than using strings for the DB types.
@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Mar 23, 2016

@cjbj

Adding a new execute() options attribute to turn off metadata gathering.

I think it's the right thing.

creating new numeric constants in lib/oracledb.js would be better than using strings for the DB types.

It's probably fair, in addition'm not sure that the lists that I have used are exhaustive.

leolmi commented Mar 23, 2016

@cjbj

Adding a new execute() options attribute to turn off metadata gathering.

I think it's the right thing.

creating new numeric constants in lib/oracledb.js would be better than using strings for the DB types.

It's probably fair, in addition'm not sure that the lists that I have used are exhaustive.

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Apr 13, 2016

Member

@leolmi now the OCA is processed (yay!), will you be able to make the changes I mentioned?

Member

cjbj commented Apr 13, 2016

@leolmi now the OCA is processed (yay!), will you be able to make the changes I mentioned?

@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Apr 13, 2016

@cjbj of course! For a few days I'll be busy in other activities, but as soon as I can I will make the changes mentioned!

leolmi commented Apr 13, 2016

@cjbj of course! For a few days I'll be busy in other activities, but as soon as I can I will make the changes mentioned!

@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Apr 13, 2016

@cjbj second commit:

  • originalType is now a numeric property of metadata item which refer to the values of the oracle.DBTYPE_XXX enum;
  • to disable metadata on result you can use noMetadata property of execute options:
connection.execute(
  "... SQL statement ...",
  [],
  { outFormat: oracle.OBJECT, noMetadata:true },
  function(err, result)
  {
    // ...
  });

leolmi commented Apr 13, 2016

@cjbj second commit:

  • originalType is now a numeric property of metadata item which refer to the values of the oracle.DBTYPE_XXX enum;
  • to disable metadata on result you can use noMetadata property of execute options:
connection.execute(
  "... SQL statement ...",
  [],
  { outFormat: oracle.OBJECT, noMetadata:true },
  function(err, result)
  {
    // ...
  });
@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Apr 13, 2016

@cjbj I haven't done extensive testing with new implementations!

leolmi commented Apr 13, 2016

@cjbj I haven't done extensive testing with new implementations!

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Apr 13, 2016

Member

@leolmi I'll look at the changes in detail later. The first thing that catches my eye is the noMetadata. Having negation in the name can be hard for people to understand. Why not have metaData: true as the default? Therefore developers would explicitly use metaData: false to disable it?

Member

cjbj commented Apr 13, 2016

@leolmi I'll look at the changes in detail later. The first thing that catches my eye is the noMetadata. Having negation in the name can be hard for people to understand. Why not have metaData: true as the default? Therefore developers would explicitly use metaData: false to disable it?

@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Apr 13, 2016

@cjbj I agree

  • to disable metadata on result you can use metaData property of execute options:
connection.execute(
  "... SQL statement ...",
  [],
  { outFormat: oracle.OBJECT, metaData:false },
  function(err, result)
  {
    // ...
  });

leolmi commented Apr 13, 2016

@cjbj I agree

  • to disable metadata on result you can use metaData property of execute options:
connection.execute(
  "... SQL statement ...",
  [],
  { outFormat: oracle.OBJECT, metaData:false },
  function(err, result)
  {
    // ...
  });
@leolmi

This comment has been minimized.

Show comment
Hide comment
@leolmi

leolmi Apr 13, 2016

4th commit: I fixed some function names to avoid problems with case

leolmi commented Apr 13, 2016

4th commit: I fixed some function names to avoid problems with case

@@ -87,6 +87,122 @@ function extend(oracledb) {
value: 0,
enumerable: true
},
DBTYPE_VARCHAR: {
value: 1001,

This comment has been minimized.

@cjbj

cjbj Apr 14, 2016

Member

Maybe use the OCI values? Or 1000+the OCI value. One reason the node-oracledb type values start at 2000 is to avoid clashing with OCI type numbers

@cjbj

cjbj Apr 14, 2016

Member

Maybe use the OCI values? Or 1000+the OCI value. One reason the node-oracledb type values start at 2000 is to avoid clashing with OCI type numbers

This comment has been minimized.

@leolmi

leolmi Apr 14, 2016

I can only get at some point, beyond that I don't have the knowledge, feel free to fix everything that needs to be corrected.

@leolmi

leolmi Apr 14, 2016

I can only get at some point, beyond that I don't have the knowledge, feel free to fix everything that needs to be corrected.

This comment has been minimized.

@cjbj

cjbj Apr 15, 2016

Member

@leolmi thanks - we can take it from here.

@cjbj

cjbj Apr 15, 2016

Member

@leolmi thanks - we can take it from here.

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Apr 14, 2016

Member

@leolmi to set expectations: I think we should target this for the release after Promises arrive. We have a lot to do at the moment in that regard.

Member

cjbj commented Apr 14, 2016

@leolmi to set expectations: I think we should target this for the release after Promises arrive. We have a lot to do at the moment in that regard.

@sanfords

This comment has been minimized.

Show comment
Hide comment
@sanfords

sanfords Apr 29, 2016

This branch fixes a really important show-stopper. And the work is almost done. Any chance you can do a priority inversion on this vs. promises?

This branch fixes a really important show-stopper. And the work is almost done. Any chance you can do a priority inversion on this vs. promises?

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Apr 29, 2016

Member

@sanfords there has been a lot of demand for Promises and we are near the end of the release cycle.

Member

cjbj commented Apr 29, 2016

@sanfords there has been a lot of demand for Promises and we are near the end of the release cycle.

@cjbj cjbj referenced this pull request Jun 3, 2016

Closed

Data type of a field #446

cjbj added a commit that referenced this pull request Jul 8, 2016

@cjbj

This comment has been minimized.

Show comment
Hide comment
@cjbj

cjbj Jul 8, 2016

Member

Yay! 1.10 is out with extended metadata support. See https://blogs.oracle.com/opal/entry/node_oracledb_1_10_has
Thanks @leolmi!

/cc @sanfords

Member

cjbj commented Jul 8, 2016

Yay! 1.10 is out with extended metadata support. See https://blogs.oracle.com/opal/entry/node_oracledb_1_10_has
Thanks @leolmi!

/cc @sanfords

@cjbj cjbj closed this Jul 8, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment