Skip to content

types(oracledb): add NCLOB to fetchAsString type#75004

Open
wiscaksono wants to merge 2 commits into
DefinitelyTyped:masterfrom
wiscaksono:fix/oracledb-nclob-fetchasstring
Open

types(oracledb): add NCLOB to fetchAsString type#75004
wiscaksono wants to merge 2 commits into
DefinitelyTyped:masterfrom
wiscaksono:fix/oracledb-nclob-fetchasstring

Conversation

@wiscaksono
Copy link
Copy Markdown

Summary

Add NCLOB to the fetchAsString type definition.

Why

oracledb v6+ supports NCLOB in fetchAsString at runtime (confirmed in lib/settings.js), but the @types/oracledb type definition was missing it, causing TypeScript errors:

// Runtime works, but TS error:
oracledb.fetchAsString = [oracledb.CLOB, oracledb.NCLOB];
//                              ~~~~~~~~~~ Type 'DbType' is not assignable...

Evidence

Runtime source (lib/settings.js):

case types.DB_TYPE_CLOB:
case types.DB_TYPE_NCLOB:
  map.set(types.DB_TYPE_CLOB, types.DB_TYPE_LONG);
  map.set(types.DB_TYPE_NCLOB, types.DB_TYPE_LONG_NVARCHAR);
  break;

NCLOB constant is already exported in the type definitions, just missing from fetchAsString.

Changes

  • types/oracledb/index.d.ts: Added typeof NCLOB to fetchAsString array type
  • types/oracledb/oracledb-tests.ts: Added oracledb.NCLOB to fetchAsString test

NCLOB is supported at runtime in oracledb v6+ (see lib/settings.js)
but was missing from the @types/oracledb fetchAsString type definition.

Runtime source confirms NCLOB handling in createFetchTypeMap:
  case types.DB_TYPE_CLOB:
  case types.DB_TYPE_NCLOB:
    map.set(types.DB_TYPE_CLOB, types.DB_TYPE_LONG);
    map.set(types.DB_TYPE_NCLOB, types.DB_TYPE_LONG_NVARCHAR);
@typescript-bot
Copy link
Copy Markdown
Contributor

typescript-bot commented May 15, 2026

@wiscaksono Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment that I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by a DT maintainer

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 75004,
  "author": "wiscaksono",
  "headCommitOid": "28ce530a65c276c88b31dc8b69ef88ce26cc1432",
  "mergeBaseOid": "ca06abb4cc3399ea070c122be329a22f1c3b6800",
  "lastPushDate": "2026-05-15T10:10:14.000Z",
  "lastActivityDate": "2026-05-15T10:10:14.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "tooManyCommits": false,
  "tooManyReviews": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "oracledb",
      "kind": "edit",
      "files": [
        {
          "path": "types/oracledb/index.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/oracledb/oracledb-tests.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "connorjayfitzgerald",
        "dannyb648",
        "jacobwheale",
        "sudarshan12s",
        "sharadraju"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 4458889970,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Copy Markdown
Contributor

🔔 @connorjayfitzgerald @dannyb648 @jacobwheale @sudarshan12s @sharadraju — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot moved this to Waiting for Code Reviews in Pull Request Status Board May 15, 2026
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board May 15, 2026
@typescript-bot typescript-bot moved this from Needs Maintainer Review to Waiting for Code Reviews in Pull Request Status Board May 15, 2026
@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in Pull Request Status Board May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Maintainer Review

Development

Successfully merging this pull request may close these issues.

2 participants