Skip to content

Commit

Permalink
Merge pull request #21 from cldcvr/fix/linting_issues
Browse files Browse the repository at this point in the history
fix: logger_test linting issue fixed
  • Loading branch information
ankitmalikg2 authored Dec 21, 2020
2 parents b39d50a + 9117213 commit 24b493d
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions storage/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,12 @@ import (
"github.com/cloudspannerecosystem/dynamodb-adapter/utils"

"cloud.google.com/go/spanner"
database "cloud.google.com/go/spanner/admin/database/apiv1"
"github.com/ahmetb/go-linq"
"google.golang.org/api/iterator"
databasepb "google.golang.org/genproto/googleapis/spanner/admin/database/v1"
)

var base64Regexp = regexp.MustCompile("^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$")

// ReadDatabaseSchema returns array of statments to create table
func ReadDatabaseSchema() ([]string, error) {
ctx := context.Background()
cli, err := database.NewDatabaseAdminClient(ctx)
if err != nil {
return nil, errors.New(err.Error())
}
defer cli.Close()
m := map[string]struct{}{}
for _, v := range models.SpannerTableMap {
m[v] = struct{}{}
}
var statments []string
for k := range m {
req := &databasepb.GetDatabaseDdlRequest{}
req.Database = "projects/" + config.ConfigurationMap.GoogleProjectID + "/instances/" + k + "/databases/" + config.ConfigurationMap.SpannerDb
ddlResp, err := cli.GetDatabaseDdl(ctx, req)
if err != nil {
return nil, errors.New(err.Error())
}
statments = append(statments, ddlResp.GetStatements()...)
}
return statments, nil
}

// SpannerBatchGet - fetch all rows
func (s Storage) SpannerBatchGet(ctx context.Context, tableName string, pKeys, sKeys []interface{}, projectionCols []string) ([]map[string]interface{}, error) {
var keySet []spanner.KeySet
Expand Down

0 comments on commit 24b493d

Please sign in to comment.