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

chore(capabilities): define native query connection capabilities #1211

Merged
merged 8 commits into from
Nov 27, 2024

Conversation

DayTF
Copy link
Contributor

@DayTF DayTF commented Nov 21, 2024

Definition of Done

General

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Validate the code quality (indentation, syntax, style, simplicity, readability)

Security

  • Consider the security impact of the changes made

@DayTF DayTF force-pushed the feat/capabilities/live-query branch from a11335c to 4c85e0a Compare November 25, 2024 09:51
Copy link

codeclimate bot commented Nov 25, 2024

Code Climate has analyzed commit 54eb825 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (98% is the threshold).

This pull request will bring the total coverage in the repository to 97.2% (0.0% change).

View more on Code Climate.

@realSpok
Copy link
Contributor

How is the dev supposed to declare that his datasource supports native queries in this PR ? 🙏

@@ -62,4 +75,18 @@ export default class CompositeDatasource<T extends Collection = Collection>

throw new Error(`Chart '${name}' is not defined in the dataSource.`);
}

async executeNativeQuery(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to test this at the moment ?

Copy link
Contributor Author

@DayTF DayTF Nov 26, 2024

Choose a reason for hiding this comment

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

The composite datasource implementation is already tested, only the real execution is not yet done as it is bound to change, I simply made the closest implementation I had in mind for it

Comment on lines +88 to +91
return this.dataSources
.find(datasource => Boolean(datasource.nativeQueryConnections[connectionName]))
.executeNativeQuery(connectionName, query, contextVariables);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

why not this ?

Suggested change
return this.dataSources
.find(datasource => Boolean(datasource.nativeQueryConnections[connectionName]))
.executeNativeQuery(connectionName, query, contextVariables);
}
return this.nativeQueryConnections[connectionName]
.executeNativeQuery(connectionName, query, contextVariables);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the datasource has the implementation of the executeNativeQuery

Copy link
Contributor

@realSpok realSpok left a comment

Choose a reason for hiding this comment

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

  • ✅ PR title

  • ✅ Destination branch

  • ✅ PR linked to the clickup task

  • ℹ️ Code review -> small question

    • ✅ Use pure functions when possible
    • ✅ Performance concerns
    • ✅ Security concerns
    • ✅ The PR tackle one subject only
  • ✅ Automatic tests

    • ✅ Unit tests
    • ⤬ Integration tests
  • ✅ Manual tests

    • ℹ️ Test the functionality. Did not the query execution
    • ⤬ Test error cases

@DayTF DayTF changed the title feat(capabilities): support for native query chore(capabilities): define native query connection capabilities Nov 27, 2024
@DayTF DayTF merged commit c9e964c into main Nov 27, 2024
22 checks passed
@DayTF DayTF deleted the feat/capabilities/live-query branch November 27, 2024 09:43
@forest-bot
Copy link
Member

🎉 This PR is included in version 1.12.6 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.11.14 🎉

The release is available on example@1.11.14

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.53.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.55.5 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.1.40 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.5.4 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.4.8 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.1.13 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.3.8 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@forest-bot
Copy link
Member

🎉 This PR is included in version 1.3.26 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants