Skip to content

Commit

Permalink
fix: add readOnly to the transaction options types and docs (#17226)
Browse files Browse the repository at this point in the history
  • Loading branch information
Parsonswy committed Mar 29, 2024
1 parent 505467b commit 7c8972f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sequelize.js
Expand Up @@ -1169,6 +1169,7 @@ class Sequelize {
* @param {string} [options.type='DEFERRED'] See `Sequelize.Transaction.TYPES` for possible options. Sqlite only.
* @param {string} [options.isolationLevel] See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options
* @param {string} [options.deferrable] Sets the constraints to be deferred or immediately checked. See `Sequelize.Deferrable`. PostgreSQL Only
* @param {boolean} [options.readOnly] Whether this transaction will only be used to read data. Used to determine whether sequelize is allowed to use a read replication server.
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @param {Function} [autoCallback] The callback is called with the transaction object, and should return a promise. If the promise is resolved, the transaction commits; if the promise rejects, the transaction rolls back
*
Expand Down
1 change: 1 addition & 0 deletions src/transaction.d.ts
Expand Up @@ -139,6 +139,7 @@ export interface TransactionOptions extends Logging {
isolationLevel?: Transaction.ISOLATION_LEVELS;
type?: Transaction.TYPES;
deferrable?: string | Deferrable;
readOnly?: boolean;
/**
* Parent transaction.
*/
Expand Down
1 change: 1 addition & 0 deletions src/transaction.js
Expand Up @@ -17,6 +17,7 @@ class Transaction {
* @param {string} [options.type] Sets the type of the transaction. Sqlite only
* @param {string} [options.isolationLevel] Sets the isolation level of the transaction.
* @param {string} [options.deferrable] Sets the constraints to be deferred or immediately checked. PostgreSQL only
* @param {boolean} [options.readOnly] Whether this transaction will only be used to read data. Used to determine whether sequelize is allowed to use a read replication server.
*/
constructor(sequelize, options) {
this.sequelize = sequelize;
Expand Down

0 comments on commit 7c8972f

Please sign in to comment.