Remove support for Google Spanner database. (#105846)

* Remove support for Google Spanner database.
This commit is contained in:
Peter Štibraný
2025-05-23 11:35:59 +02:00
committed by GitHub
parent 9769871a88
commit c4d3eb1cd0
50 changed files with 26 additions and 1265 deletions

View File

@ -373,11 +373,6 @@ func (ss *SQLStore) RecursiveQueriesAreSupported() (bool, error) {
return *ss.recursiveQueriesAreSupported, nil
}
recursiveQueriesAreSupported := func() (bool, error) {
if ss.GetDBType() == migrator.Spanner {
// no need to try...
return false, nil
}
var result []int
if err := ss.WithDbSession(context.Background(), func(sess *DBSession) error {
recQry := `WITH RECURSIVE cte (n) AS
@ -414,7 +409,6 @@ var testSQLStoreSetup = false
var testSQLStore *SQLStore
var testSQLStoreMutex sync.Mutex
var testSQLStoreCleanup []func()
var testSQLStoreSkipTestsOnBackend string // When not empty and matches DB type, test is skipped.
// InitTestDBOpt contains options for InitTestDB.
type InitTestDBOpt struct {
@ -459,12 +453,6 @@ func SetupTestDB() {
testSQLStoreSetup = true
}
func SkipTestsOnSpanner() {
testSQLStoreMutex.Lock()
defer testSQLStoreMutex.Unlock()
testSQLStoreSkipTestsOnBackend = "spanner"
}
func CleanupTestDB() {
testSQLStoreMutex.Lock()
defer testSQLStoreMutex.Unlock()
@ -549,10 +537,6 @@ func TestMain(m *testing.M) {
if testSQLStore == nil {
dbType := sqlutil.GetTestDBType()
if testSQLStoreSkipTestsOnBackend != "" && testSQLStoreSkipTestsOnBackend == dbType {
t.Skipf("test skipped when using DB type %s", testSQLStoreSkipTestsOnBackend)
}
// set test db config
cfg := setting.NewCfg()
// nolint:staticcheck