diff --git a/types/oracledb/index.d.ts b/types/oracledb/index.d.ts index 2b2298e8dc..a1fe79a22c 100644 --- a/types/oracledb/index.d.ts +++ b/types/oracledb/index.d.ts @@ -1128,14 +1128,14 @@ declare namespace OracleDB { /** Array of objects specifying the queries which were affected by the Query Change notification. */ tables: SubscriptionTables; }[]; - /** Indicates whether the subscription is registerd with the database. */ - registered?: boolean; + /** Indicates whether the subscription is registered with the database. */ + registered: boolean; /** Array of objects specifying the tables which were affected by the notification. */ tables?: SubscriptionTables[]; /** Buffer containing the identifier of the transaction which spawned the notification. */ - txId?: Buffer; + txId: Buffer; /** Type of notification sent. One of the Subscribe Event Type Constants. */ - type?: number; + type: number; } /** @@ -1268,7 +1268,7 @@ declare namespace OracleDB { /** * The Oracle error number. This value is undefined for non-Oracle errors and for messages prefixed with NJS or DPI. */ - errorNum: number; + errorNum?: number; /** * The text of the error message. * @@ -1282,7 +1282,7 @@ declare namespace OracleDB { * * The value may be 0 in non-SQL contexts. This value is undefined for non-Oracle errors and for messages prefixed with NJS or DPI. */ - offset: number; + offset?: number; } /** @@ -1532,6 +1532,14 @@ declare namespace OracleDB { * @see https://oracle.github.io/node-oracledb/doc/api.html#oracledbconstantsdbtype */ dbType: number; + /** + * The class associated with the database type. This is only set if the database type is an object type. + */ + dbTypeClass: DBObjectClass; + /** + * Name of the database type, such as “NUMBER” or “VARCHAR2”. For object types, this will be the object name. + */ + dbTypeName: string; /** * Database byte size. This is only set for DB_TYPE_VARCHAR, DB_TYPE_CHAR and DB_TYPE_RAW column types. */ @@ -1565,7 +1573,7 @@ declare namespace OracleDB { /** * The alias of this pool in the connection pool cache. An alias cannot be changed once the pool has been created. */ - readonly poolAlias: string; + readonly poolAlias?: string; /** * The number of connections that are opened whenever a connection request exceeds the number of currently open connections. */ @@ -1897,7 +1905,7 @@ declare namespace OracleDB { * * This is defined only if payloadType has the value oracledb.DB_TYPE_OBJECT. */ - readonly payloadTypeClass: DBObjectClass; + readonly payloadTypeClass?: DBObjectClass; /** Either the string “RAW” or the name of the Oracle Database object type identified when the queue was created. */ readonly payloadTypeName: string; @@ -1912,8 +1920,8 @@ declare namespace OracleDB { /** * Dequeues a single message. Depending on the dequeue options, the message may also be returned as undefined if no message is available. */ - deqOne(): Promise; - deqOne(callback: (error: DBError, messages: AdvancedQueueMessage) => void): void; + deqOne(): Promise; + deqOne(callback: (error: DBError, message?: AdvancedQueueMessage) => void): void; /** * Enqueues multiple messages. @@ -2133,13 +2141,13 @@ declare namespace OracleDB { * Each column’s name is always given. If the oracledb.extendedMetaData or execute() option extendedMetaData * are true then additional information is included. */ - metaData: Metadata[]; + metaData?: Metadata[]; /** * This contains the output values of OUT and IN OUT binds. If bindParams is passed as an array, * then outBinds is returned as an array. If bindParams is passed as an object, * then outBinds is returned as an object. If there are no OUT or IN OUT binds, the value is undefined. */ - outBinds: T; + outBinds?: T; /** * For SELECT statements when the resultSet option is true, use the resultSet object to fetch rows. * @@ -2149,7 +2157,7 @@ declare namespace OracleDB { * @see https://oracle.github.io/node-oracledb/doc/api.html#resultsetclass * @see https://oracle.github.io/node-oracledb/doc/api.html#resultsethandling */ - resultSet: ResultSet; + resultSet?: ResultSet; /** * For SELECT statements using direct fetches, rows contains an array of fetched rows. * It will be NULL if there is an error or the SQL statement was not a SELECT statement. @@ -2160,13 +2168,13 @@ declare namespace OracleDB { * The number of rows returned is limited by oracledb.maxRows or the maxRows option in an execute() call. * If maxRows is 0, then the number of rows is limited by Node.js memory constraints. */ - rows: T[]; + rows?: T[]; /** * For DML statements (including SELECT FOR UPDATE) this contains the number of rows affected, * for example the number of rows inserted. For non-DML statements such as queries and PL/SQL statements, * rowsAffected is undefined. */ - rowsAffected: number; + rowsAffected?: number; } /** @@ -2183,26 +2191,26 @@ declare namespace OracleDB { * data errors to report. Some classes of execution error will always return via the executeMany() * callback error object, not in batchErrors. */ - batchErrors: DBError[]; + batchErrors?: DBError[]; /** * An array of integers identifying the number of rows affected by each record of the binds parameter. * * It is present only if dmlRowCounts was true in the executeMany() options parameter and a DML statement * was executed. */ - dmlRowCounts: number[]; + dmlRowCounts?: number[]; /** * Contains the value of any returned IN OUT or OUT binds. It is an array of arrays, or an array of objects, * depending on the binds parameters structure. The length of the array will correspond to the length of * the array passed as the binds parameter. It will be present only if there is at least one OUT bind * variable identified. */ - outBinds: T[]; + outBinds?: T[]; /** * An integer identifying the total number of database rows affected by the processing of all records * of the binds parameter. It is only present if a DML statement was executed. */ - rowsAffected: number; + rowsAffected?: number; } /** @@ -2368,8 +2376,8 @@ declare namespace OracleDB { * * @since 3.0 */ - openCollection(collectionName: string): Promise; - openCollection(collectionName: string, callback: (error: DBError, collection: SodaCollection) => void): void; + openCollection(collectionName: string): Promise; + openCollection(collectionName: string, callback: (error: DBError, collection?: SodaCollection) => void): void; } /** @@ -2588,9 +2596,9 @@ declare namespace OracleDB { */ interface SodaDocument { /** Creation time of the document as a string in the UTC time zone using an ISO8601 format. */ - readonly createdOn: string; + readonly createdOn?: string; /** Unique key value for this document. */ - readonly key: string; + readonly key?: string; /** Last modified time of the document as a string in the UTC time zone using an ISO8601 format. */ readonly lastModified: string; /** @@ -2598,8 +2606,10 @@ declare namespace OracleDB { * By default, collections store only JSON document content and this property will be ‘application/json’. This property will be null if the media type * is unknown, which will only be in the rare case when a collection was created to store mixed or non-JSON content on top of a pre-existing database table, * and that table has NULLs in its mediaType column. + * + * @default 'application/json' */ - readonly mediaType: string; + readonly mediaType?: string; /** Version of the document. */ readonly version: string; @@ -2655,8 +2665,8 @@ declare namespace OracleDB { * * @since 3.0 */ - getNext(): Promise; - getNext(callback: (error: DBError, document: SodaDocument) => void): void; + getNext(): Promise; + getNext(callback: (error: DBError, document?: SodaDocument) => void): void; } /** @@ -2800,8 +2810,8 @@ declare namespace OracleDB { * * @since 3.0 */ - getOne(): Promise; - getOne(callback: (error: DBError, document: SodaDocument) => void): void; + getOne(): Promise; + getOne(callback: (error: DBError, document?: SodaDocument) => void): void; /** * Removes a set of documents matching the SodaOperation query criteria. * @@ -2878,8 +2888,8 @@ declare namespace OracleDB { * * @since 3.0 */ - replaceOneAndGet(newDocument: SodaDocument): Promise; - replaceOneAndGet(newDocument: SodaDocument, callback: (error: DBError, document: SodaDocument) => void): void; + replaceOneAndGet(newDocument: SodaDocument): Promise; + replaceOneAndGet(newDocument: SodaDocument, callback: (error: DBError, document?: SodaDocument) => void): void; /** * Replaces a document in a collection. This is similar to replaceOne(), but also returns the result document, * which contains all SodaDocument components (key, version, etc.) except for content.