apache / apache/hop

[Feature Request]: Database plugin query comment injection

Open
#3,261 3 comments 0 reactions 0 assignees View on GitHub
Database P3
Dominant language
Java
Stars
1.5k
Forks
476
Avg merge
18h 33m
Merged PRs (30d)
204

Description

### What would you like to happen?

Hello, opening this feature request as a follow-up to this thread: https://chat.project-hop.org/hop/pl/sx5ye8z5ntf9xyu9eab1ibgqwy. My team is developing our own Hop database plugin (i.e. extending `BaseDatabaseMeta`) and have a use case in which we would like to include a comment in every SQL query sent using our custom database plugin. Ideally, this functionality would be specified in the `IDatabase` interface and available to implement/override in our plugin implementation. This would be similar to the existing: `getConnectSql()` method of the `IDatabase` interface. So something like:
```
interface IDatabase {
String getSqlComment();
}
```
Then this `getSqlComment()` method could be called by the `Database` class when executing queries, similar to the `Database` class calling `getConnectSql()` when connecting. Happy to answer any questions, thanks for the consideration!

### Issue Priority

Priority: 3

### Issue Component

Component: Database

Contributor guide

Open the contributing guide

Research direction

Start by reading the IDatabase interface, BaseDatabaseMeta, and the Database class, comparing the requested behavior with getConnectSql() and locating where queries are executed. Check existing database-related tests if present; done means custom database plugins can provide a SQL comment and queries sent through Database consistently include it.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.