Skip to content

Commit

Permalink
Project import generated by Copybara. (#91)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: e42f6a91a0b4f6ff7a9b8ec6b80de893af099771

Co-authored-by: A. Googler <[email protected]>
  • Loading branch information
1 parent d3ce8c2 commit 73518e8
Show file tree
Hide file tree
Showing 40 changed files with 731 additions and 394 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ with:
VERSION=1.4.2
docker run -p 9010:9010 -p 9020:9020 gcr.io/cloud-spanner-emulator/emulator:$VERSION
```
Works on x86 and arm64 architectures.

### Via pre-built linux binaries

Expand Down Expand Up @@ -84,6 +85,7 @@ emulator via bazel from the source root with:
```shell
bazel run binaries/gateway_main
```
Works on x86 and arm64 architectures.

### Via custom docker image

Expand All @@ -101,6 +103,7 @@ docker run -p 9010:9010 -p 9020:9020 emulator

The first port is the gRPC port and the second port is the REST port.

Works on x86 and arm64 architectures.

## Technical Details

Expand Down Expand Up @@ -209,6 +212,9 @@ Notable limitations:
hints. However, index names generated in the emulator cannot be used in the
emulator or in production.

- The [Cloud Spanner PostgreSQL interface](
https://cloud.google.com/spanner/docs/postgresql-interface) is not supported.

## Frequently Asked Questions (FAQ)


Expand Down
1 change: 1 addition & 0 deletions backend/schema/catalog/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ cc_library(
"//common:errors",
"//common:limits",
"@com_google_absl//absl/algorithm:container",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
Expand Down
8 changes: 4 additions & 4 deletions backend/schema/catalog/schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include "backend/schema/catalog/index.h"
#include "backend/schema/catalog/table.h"
#include "backend/schema/graph/schema_node.h"
#include "common/errors.h"
#include "absl/status/status.h"

namespace google {
namespace spanner {
Expand Down Expand Up @@ -58,8 +56,10 @@ const Index* Schema::FindIndex(const std::string& index_name) const {
return itr->second;
}

Schema::Schema(std::unique_ptr<const SchemaGraph> graph)
: graph_(std::move(graph)) {
Schema::Schema(std::unique_ptr<const SchemaGraph> graph
)
: graph_(std::move(graph))
{
tables_.clear();
tables_map_.clear();
index_map_.clear();
Expand Down
11 changes: 6 additions & 5 deletions backend/schema/catalog/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,14 @@
#define THIRD_PARTY_CLOUD_SPANNER_EMULATOR_BACKEND_SCHEMA_CATALOG_SCHEMA_H_

#include <memory>
#include <string>
#include <vector>

#include "absl/container/flat_hash_map.h"
#include "absl/memory/memory.h"
#include "absl/types/span.h"
#include "backend/common/case.h"
#include "backend/schema/catalog/index.h"
#include "backend/schema/catalog/table.h"
#include "backend/schema/graph/schema_graph.h"
#include "absl/status/status.h"

namespace google {
namespace spanner {
Expand All @@ -39,9 +37,12 @@ namespace backend {
// relationships.
class Schema {
public:
Schema() : graph_(std::make_unique<SchemaGraph>()) {}
Schema()
: graph_(std::make_unique<SchemaGraph>())
{}

explicit Schema(std::unique_ptr<const SchemaGraph> graph);
explicit Schema(std::unique_ptr<const SchemaGraph> graph
);

// Returns the generation number of this schema.
int64_t generation() const { return generation_; }
Expand Down
8 changes: 6 additions & 2 deletions backend/schema/parser/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ cc_library(
"//common:errors",
"//common:feature_flags",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:span",
"@com_google_zetasql//zetasql/base",
"@com_google_protobuf//:protobuf_headers",
],
)

Expand All @@ -55,7 +55,11 @@ cc_test(
"//tests/common:proto_matchers",
"//tests/common:scoped_feature_flags_setter",
"@com_github_grpc_grpc//:grpc++",
"@com_google_absl//absl/status",
"@com_google_absl//absl/status:statusor",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest_main",
"@com_google_protobuf//:protobuf",
"@com_google_zetasql//zetasql/base/testing:status_matchers",
],
)
Expand Down
Loading

0 comments on commit 73518e8

Please sign in to comment.