Giter VIP home page Giter VIP logo

spanner's Introduction

spanner

message Singer {
  option (spanner.ddl.schema) = {
    database: "test"
    table: "Singers"
    index {
      name: "SingersByFirstLastName"
      columns: "FirstName, LastName"
    }
    index {
      name: "SingersByFirstLastNameNoNulls"
      columns: "FirstName, LastName"
      null_filtered: true
    }
    primary_key: "SingerId"
  };
  int64  id          = 1
    [(spanner.ddl.column) = {name: "SingerId"}];
  string first_name  = 2
    [(spanner.ddl.column) = {size: 1024}];
  string last_name   = 3
    [(spanner.ddl.column) = {size: 1024 nullable: true}];
  bytes  singer_info = 4
    [(spanner.ddl.column) = {nullable: true}];
}

message Album {
  option (spanner.ddl.schema) = {
    database: "test"
    table: "Albums"
    index {
      name: "AlbumsByAlbumTitle"
      columns: "AlbumTitle"
    }
    index {
      name: "AlbumsByUniqueAlbumId"
      columns: "AlbumId"
      unique: true
    }
    primary_key: "SingerId, AlbumId"
    interleave: "Singers"
  };
  int64  id               = 1
    [(spanner.ddl.column) = {name: "SingerId"}];
  int64  album_id         = 2;
  string album_title      = 3
    [(spanner.ddl.column) = {nullable: true}];
  int64  marketing_budget = 4
    [(spanner.ddl.column) = {nullable: true}];
}

message Song {
  option (spanner.ddl.schema) = {
    database: "test"
    table: "Songs"
    primary_key: "SingerId, AlbumId, TrackId"
    interleave: "Albums"
    index {
      name: "SongsBySongName"
      columns: "SongName"
    }
    index {
      name: "SongsBySingerAlbumSongName"
      columns: "SingerId, AlbumId, SongName"
      interleave: "Albums"
    }
    index {
      name: "SongsBySingerAlbumSongNameDesc"
      columns: "SingerId, AlbumId, SongName DESC"
      interleave: "Albums"
    }
  };
  int64 id         = 1
    [(spanner.ddl.column) = {name: "SingerId"}];
  int64  album_id  = 2;
  int64  track_id  = 3;
  string song_name = 4
    [(spanner.ddl.column) = {size: MAX, nullable: true}];
}

test時に設定させる

func TestMain(m *testing.M) {
	opt := WithPrefixDatabase("")
	Setup()
	code := m.Run()
	os.Exit(code)
}

spanner's People

Contributors

yu-icchi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.