Skip to content

chore: fixed mariadb url capture for esm#2551

Merged
aryamohanan merged 2 commits into
mainfrom
chore-mariadb-fix-esm
May 15, 2026
Merged

chore: fixed mariadb url capture for esm#2551
aryamohanan merged 2 commits into
mainfrom
chore-mariadb-fix-esm

Conversation

@aryamohanan
Copy link
Copy Markdown
Contributor

@aryamohanan aryamohanan commented May 15, 2026

ESM tests were failing on main due to prisma mariadb adapter not capturing url for ESM apps.

@aryamohanan aryamohanan marked this pull request as ready for review May 15, 2026 09:11
@aryamohanan aryamohanan requested a review from a team as a code owner May 15, 2026 09:11
};
const isGetterExport = !!Object.getOwnPropertyDescriptor(mariadbAdapterModule, 'PrismaMariaDb')?.get;
// CJS: PrismaMariaDb is a getter property
if (isGetterExport) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is wrong here.

CJS e.g.

Original vs Modified

{ PrismaMariaDb: [Getter] }
{ PrismaMariaDb: [class InstanaPrismaMariaDb extends PrismaMariaDbAdapterFactory] }

I expect:

{ InstanaPrismaMariaDb: [Getter] }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to preserve the original getter semantics

};
}
// ESM: PrismaMariaDb is a direct export
mariadbAdapterModule.PrismaMariaDb = InstanaPrismaMariaDb;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESM is correct

@sonarqubecloud
Copy link
Copy Markdown

@aryamohanan aryamohanan merged commit 74db8ea into main May 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants