drizzle-team/drizzle-orm · error · TransactionRollbackError

Rollback

Error message

Rollback

What it means

Error "Rollback" thrown in drizzle-team/drizzle-orm.

Source

Thrown at drizzle-orm/src/sqlite-core/session.ts:352

> extends BaseSQLiteDatabase<TResultType, TRunResult, TFullSchema, TSchema> {
	static override readonly [entityKind]: string = 'SQLiteTransaction';

	constructor(
		resultType: TResultType,
		dialect: { sync: SQLiteSyncDialect; async: SQLiteAsyncDialect }[TResultType],
		session: SQLiteSession<TResultType, TRunResult, TFullSchema, TSchema>,
		protected schema: {
			fullSchema: Record<string, unknown>;
			schema: TSchema;
			tableNamesMap: Record<string, string>;
		} | undefined,
		protected readonly nestedIndex = 0,
	) {
		super(resultType, dialect, session, schema);
	}

	rollback(): never {
		throw new TransactionRollbackError();
	}
}

View on GitHub (pinned to b7862528fd)

Solutions

  1. This error is thrown intentionally to roll back a transaction; throw it only inside db.transaction() callbacks when you want to abort.
  2. If unexpected, inspect the transaction callback for a thrown Rollback instance and handle the business condition differently.

When it happens

Trigger: A sqlite transaction callback throws (or tx.rollback() is called), causing Drizzle to raise the Rollback signal.

Common situations: Intentional rollback via tx.rollback(); unhandled error inside the transaction body.


AI-assisted analysis of drizzle-team/drizzle-orm@b7862528fd (2026-08-03). Data as JSON: /data/errors/c5baabd0de3decc1.json. Report an issue: GitHub.