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

Develop SQL Extension #422

Open
NassimBtk opened this issue Sep 23, 2024 · 1 comment · Fixed by #443 · May be fixed by #482
Open

Develop SQL Extension #422

NassimBtk opened this issue Sep 23, 2024 · 1 comment · Fixed by #443 · May be fixed by #482
Assignees
Milestone

Comments

@NassimBtk
Copy link
Member

NassimBtk commented Sep 23, 2024

Specification

JDBC SQL User's Configuration

metricshub.yaml

resources:
  db-host:
    attributes:
    # ...
    protocols:
      sql:
        username: #
        password: #
        url: #  
        timeout: # 
        type: # 
        port: # 
        database: #
Attribute Data Type Description Default Value
username string The username used to authenticate with the database. null
password char[] The password used for authentication (can be encrypted). null
url char[] The connection URL for the database (can be encrypted). null or generated based on type and database.
timeout int The time in seconds before a connection attempt times out. 120 seconds
type string The type of database engine (e.g., oracle, postgresql, mariadb, mssql, informix, derby, h2, ...). null
port int The port number to connect to the database. null or generated based on type
database string The database name to connect to. null

SQL Criterion

criteria:
- type: sql
  query: # 
  expectedResult: #
  errorMessage:
Attribute Key Data Type Description
type string Specifies the type of SQL criterion (sql).
query string The SQL query string to be executed (e.g., SELECT Column1, Column2 FROM TABLE).
expectedResult string The expected result in the SQL response
errorMessage string The error message to display in case of criterion failure

SQL Source

<source-name>:
   type: sql
   query: # 
Attribute Key Data Type Description
type string Specifies the type of SQL source (sql).
query string The SQL query string to be executed (e.g., SELECT Column1, Column2 FROM TABLE).

To differentiate the current source, which executes inner SQL queries using the internal MetricsHub DB engine, we should consider renaming the type of the inner SQL source to reflect its engine-based nature. A suitable option could be localSql.

  • Should we support for SELECT * FROM TABLE
    • If yes, we need to define a new attribute columns in the sql source.
  • Should we override the url in a source
    • If yes, we need to define a new attribute url, that overrides the user's url. It that, in the new url, macros should be correctly replaced by the engine.
@NassimBtk
Copy link
Member Author

@bertysentry your thoughts! 😉

@SafaeAJ SafaeAJ changed the title Develop JDBC Extension Develop SQL Extension Oct 1, 2024
SafaeAJ added a commit that referenced this issue Oct 9, 2024
SafaeAJ added a commit that referenced this issue Oct 9, 2024
@NassimBtk NassimBtk linked a pull request Oct 10, 2024 that will close this issue
SafaeAJ added a commit that referenced this issue Oct 10, 2024
NassimBtk added a commit that referenced this issue Oct 10, 2024
…sql-source-module-to-localSql

Issue #422: Rename SQL Source Module to localSql Source
@NassimBtk NassimBtk reopened this Oct 10, 2024
@NassimBtk NassimBtk added this to the 1.0.02 milestone Oct 22, 2024
@iguitton iguitton self-assigned this Oct 28, 2024
SafaeAJ added a commit that referenced this issue Nov 12, 2024
SafaeAJ added a commit that referenced this issue Nov 12, 2024
SafaeAJ added a commit that referenced this issue Nov 12, 2024
SafaeAJ added a commit that referenced this issue Nov 12, 2024
SafaeAJ added a commit that referenced this issue Nov 13, 2024
@SafaeAJ SafaeAJ linked a pull request Nov 13, 2024 that will close this issue
SafaeAJ added a commit that referenced this issue Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment