Skip to content

Commit

Permalink
fix: add support for multiple data source type starting with MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
eddydecena committed Jul 27, 2024
1 parent 2c36846 commit 86dd57a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions internal/services/trino.engine.impl.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@ func (self *TrinoEngineServiceImpl) Query(query string, dest interface{}) error
rows, err := self.db.Query(query)

Check failure

Code scanning / CodeQL

Database query built from user-controlled sources High

This query depends on a
user-provided value
.
This query depends on a
user-provided value
.
if err != nil {
logger.Error.Printf("Failed to get data from data source: %v\n", err)
logger.Error.Printf("Query: \n\n%s\n\n", query)
return err
}

var columns []string
columns, err = rows.Columns()
if err != nil {
logger.Error.Printf("Failed to get data from data source: %v\n", err)
logger.Error.Printf("Query: \n\n%s\n\n", query)
return err
}

Expand All @@ -72,7 +70,6 @@ func (self *TrinoEngineServiceImpl) Query(query string, dest interface{}) error
err = rows.Scan(r...)
if err != nil {
logger.Error.Printf("Failed to get data from data source: %v\n", err)
logger.Error.Printf("Query: \n\n%s\n\n", query)
return err
}

Expand Down Expand Up @@ -108,15 +105,13 @@ func (self *TrinoEngineServiceImpl) GetRawData(query string) ([]map[string]inter

if err != nil {
logger.Error.Printf("Failed to get data from data source: %v\n", err)
logger.Error.Printf("Query: \n\n%s\n\n", query)
return nil, err
}

var columns []string
columns, err = rows.Columns()
if err != nil {
logger.Error.Printf("Failed to get data from data source: %v\n", err)
logger.Error.Printf("Query: \n\n%s\n\n", query)
return nil, err
}

Expand All @@ -135,7 +130,6 @@ func (self *TrinoEngineServiceImpl) GetRawData(query string) ([]map[string]inter
err = rows.Scan(r...)
if err != nil {
logger.Error.Printf("Failed to get data from data source: %v\n", err)
logger.Error.Printf("Query: \n\n%s\n\n", query)
return nil, err
}

Expand Down

0 comments on commit 86dd57a

Please sign in to comment.