mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Add function for detecting if the SQL driver supported CTEs (#64441)
* Add interface method for detecting if the SQL driver supported CTEs * Update nested folder store to call RecursiveQueriesAreSupported()
This commit is contained in:
committed by
GitHub
parent
fd6e97d52d
commit
4ee0be6fdf
@@ -20,6 +20,9 @@ type DB interface {
|
||||
GetSqlxSession() *session.SessionDB
|
||||
InTransaction(ctx context.Context, fn func(ctx context.Context) error) error
|
||||
Quote(value string) string
|
||||
// RecursiveQueriesAreSupported runs a dummy recursive query and it returns true
|
||||
// if the query runs successfully or false if it fails with mysqlerr.ER_PARSE_ERROR error or any other error
|
||||
RecursiveQueriesAreSupported() (bool, error)
|
||||
}
|
||||
|
||||
type Session = sqlstore.DBSession
|
||||
|
||||
@@ -51,6 +51,10 @@ func (f *FakeDB) Quote(value string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (f *FakeDB) RecursiveQueriesAreSupported() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// TODO: service-specific methods not yet split out ; to be removed
|
||||
func (f *FakeDB) UpdateTempUserWithEmailSent(ctx context.Context, cmd *tempuser.UpdateTempUserWithEmailSentCommand) error {
|
||||
return f.ExpectedError
|
||||
|
||||
Reference in New Issue
Block a user