Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mysql): add isRoot parameter to executeQuery #882

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeengbe
Copy link

@jeengbe jeengbe commented Dec 11, 2024

It's convenient to be able to perform root operations directly on the container. The parameter is optional and defaults to the current behaviour, so it's no breaking change.

Copy link

netlify bot commented Dec 11, 2024

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit b8118db
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-node/deploys/677e69306d57a400084b85d2
😎 Deploy Preview https://deploy-preview-882--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jeengbe jeengbe marked this pull request as ready for review December 11, 2024 15:21
const queryResult = await container.executeQuery("SELECT 1 as res");
expect(queryResult).toEqual(expect.stringContaining("res\n1\n"));

// Test root user
const rootQueryResult = await container.executeQuery("SELECT CURRENT_USER() as user");
Copy link
Collaborator

@cristianrgreco cristianrgreco Jan 8, 2025

Choose a reason for hiding this comment

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

How does this test test the new isRoot parameter? Also please add a separate test

Copy link
Author

@jeengbe jeengbe Jan 8, 2025

Choose a reason for hiding this comment

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

Here we go, fixed. I apologise for the incomplete PR, I don't know what happened.

I kept the "test non-root and root in the same test" approach as is done in the "should work with database URI" test

@cristianrgreco cristianrgreco added enhancement New feature or request minor Backward compatible functionality labels Jan 8, 2025
@jeengbe jeengbe force-pushed the je-mysql-execute-query-root branch from da1a560 to b8118db Compare January 8, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor Backward compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants