Remove support for Google Spanner database. (#105846)
* Remove support for Google Spanner database.
This commit is contained in:
@@ -24,8 +24,6 @@ func DialectForDriver(driverName string) Dialect {
|
||||
return PostgreSQL
|
||||
case "sqlite", "sqlite3":
|
||||
return SQLite
|
||||
case "spanner":
|
||||
return Spanner
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
package sqltemplate
|
||||
|
||||
// Spanner is an implementation of Dialect for the Google Spanner database.
|
||||
var Spanner = spanner{}
|
||||
|
||||
var _ Dialect = Spanner
|
||||
|
||||
type spanner struct{}
|
||||
|
||||
func (s spanner) DialectName() string {
|
||||
return "spanner"
|
||||
}
|
||||
|
||||
func (s spanner) Ident(a string) (string, error) {
|
||||
return backtickIdent{}.Ident(a)
|
||||
}
|
||||
|
||||
func (s spanner) ArgPlaceholder(argNum int) string {
|
||||
return argFmtSQL92.ArgPlaceholder(argNum)
|
||||
}
|
||||
|
||||
func (s spanner) SelectFor(a ...string) (string, error) {
|
||||
return rowLockingClauseSpanner.SelectFor(a...)
|
||||
}
|
||||
|
||||
func (spanner) CurrentEpoch() string {
|
||||
return "UNIX_MICROS(CURRENT_TIMESTAMP())"
|
||||
}
|
||||
|
||||
var rowLockingClauseSpanner = rowLockingClauseMap{
|
||||
SelectForUpdate: SelectForUpdate,
|
||||
}
|
||||
@@ -6,6 +6,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
||||
@@ -15,7 +17,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/storage/unified/sql"
|
||||
"github.com/grafana/grafana/pkg/storage/unified/sql/db/dbimpl"
|
||||
test "github.com/grafana/grafana/pkg/storage/unified/testing"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func newTestBackend(b testing.TB) resource.StorageBackend {
|
||||
@@ -40,9 +41,6 @@ func TestIntegrationBenchmarkSQLStorageBackend(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
if db.IsTestDBSpanner() {
|
||||
t.Skip("Skipping benchmark on Spanner")
|
||||
}
|
||||
opts := test.DefaultBenchmarkOptions()
|
||||
if db.IsTestDbSQLite() {
|
||||
opts.Concurrency = 1 // to avoid SQLite database is locked error
|
||||
@@ -54,9 +52,6 @@ func TestIntegrationBenchmarkResourceServer(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
if db.IsTestDBSpanner() {
|
||||
t.Skip("Skipping benchmark on Spanner")
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
opts := &test.BenchmarkOptions{
|
||||
|
||||
@@ -35,9 +35,6 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
|
||||
func TestIntegrationStorageServer(t *testing.T) {
|
||||
if db.IsTestDBSpanner() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
unitest.RunStorageServerTest(t, func(ctx context.Context) resource.StorageBackend {
|
||||
dbstore := db.InitTestDB(t)
|
||||
eDB, err := dbimpl.ProvideResourceDB(dbstore, setting.NewCfg(), nil)
|
||||
@@ -58,10 +55,6 @@ func TestIntegrationStorageServer(t *testing.T) {
|
||||
|
||||
// TestStorageBackend is a test for the StorageBackend interface.
|
||||
func TestIntegrationSQLStorageBackend(t *testing.T) {
|
||||
if db.IsTestDBSpanner() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
|
||||
t.Run("IsHA (polling notifier)", func(t *testing.T) {
|
||||
unitest.RunStorageBackendTest(t, func(ctx context.Context) resource.StorageBackend {
|
||||
dbstore := db.InitTestDB(t)
|
||||
@@ -105,9 +98,6 @@ func TestIntegrationSearchAndStorage(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("skipping integration test in short mode")
|
||||
}
|
||||
if db.IsTestDBSpanner() {
|
||||
t.Skip("Skipping benchmark on Spanner")
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -145,9 +135,6 @@ func TestClientServer(t *testing.T) {
|
||||
if db.IsTestDbSQLite() {
|
||||
t.Skip("TODO: test blocking, skipping to unblock Enterprise until we fix this")
|
||||
}
|
||||
if db.IsTestDBSpanner() {
|
||||
t.Skip("skipping integration test")
|
||||
}
|
||||
|
||||
ctx := testutil.NewTestContext(t, time.Now().Add(5*time.Second))
|
||||
dbstore := db.InitTestDB(t)
|
||||
|
||||
Reference in New Issue
Block a user