Skip to content

[BUG]: [1.0.0.rc1] PgAsyncDatabase.transaction is defined as an instance field rather than an instance method #5709

@mdoi2

Description

@mdoi2

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

1.0.0.rc1

What version of drizzle-kit are you using?

1.0.0.rc1

Other packages

No response

Describe the Bug

PgAsyncDatabase.transaction is defined as an instance field rather than an instance method.

Current code

	transaction: <T>(
		transaction: (tx: PgAsyncTransaction<TQueryResult, TRelations>) => Promise<T>,
		config?: PgTransactionConfig,
	) => Promise<T> = (tx, cfg) => this.session.transaction(tx, cfg);

Expected code

	transaction: <T>(
		transaction: (tx: PgAsyncTransaction<TQueryResult, TRelations>) => Promise<T>,
		config?: PgTransactionConfig,
	): Promise<T> {
		return this.session.transaction(transaction, config);
	}

NodePgTransaction and PgEffectDatabase appears to have a similar issue.

In my project, I had been accessing the PgAsyncDatabase (To be precise, NodePgDatabase) prototype to make minor changes to its behavior and perform analysis, but this issue has made that impossible.

I realize this is not the recommended way to use it, but I would be very grateful if you could fix it.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions