feat(orm): add query proto codegen (#13438)

## Description

This starts the implementation of approach (C) in #11774 by generating `_query.proto` files for `.proto` files which have ORM definitions. It does this using a new protoc plugin called `protoc-gen-go-cosmos-orm-proto`.

Please review `bank_query.proto` and `test_schema_query.proto` as these are the outputs of the codegen.

The approach taken does not attempt to do any sort of logical queries as discussed in #11774 and instead provides direct index access in the most simple and complete way that we can easily implement now. More advanced things in #11774 could be implemented later, but this should be possible to deliver relatively quickly and should allow developers to completely skip writing gRPC queries manually if they use ORM.

Note that the implementation of these queries can provide merkle proofs because the mapping to state is well known.

I did need to disable pulsar codegen in this PR because it doesn't support proto3 optionals which are needed here (depends on https://github.com/cosmos/cosmos-proto/issues/12). Fortunately, pulsar is 100% compatible with the official google codegen and there is no problem running ORM tests against the official codegen.



---

### Author Checklist

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting))
- [ ] provided a link to the relevant issue or specification
- [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/building-modules)
- [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing)
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

### Reviewers Checklist

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed 
- [ ] reviewed state machine logic
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
This commit is contained in:
Aaron Craelius 2022-10-07 10:37:04 -04:00 committed by GitHub
parent 5f01f6f5e5
commit 2151427b5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 8711 additions and 6908 deletions

View File

@ -1,3 +1,7 @@
codegen:
go install ./cmd/protoc-gen-go-cosmos-orm
go install ./cmd/protoc-gen-go-cosmos-orm-proto
# generate .proto files first
(cd internal; buf generate --template buf.proto.gen.yaml)
# generate go code
(cd internal; buf generate)

View File

@ -0,0 +1,11 @@
package main
import (
"google.golang.org/protobuf/compiler/protogen"
"github.com/cosmos/cosmos-sdk/orm/internal/codegen"
)
func main() {
protogen.Options{}.Run(codegen.QueryProtoPluginRunner)
}

View File

@ -7,5 +7,5 @@ import (
)
func main() {
protogen.Options{}.Run(codegen.PluginRunner)
protogen.Options{}.Run(codegen.ORMPluginRunner)
}

View File

@ -6,7 +6,10 @@ managed:
override:
buf.build/cosmos/cosmos-sdk: cosmossdk.io/api
plugins:
- name: go-pulsar
- name: go
out: .
opt: paths=source_relative
- name: go-grpc
out: .
opt: paths=source_relative
- name: go-cosmos-orm

View File

@ -0,0 +1,11 @@
version: v1
managed:
enabled: true
go_package_prefix:
default: github.com/cosmos/cosmos-sdk/orm/internal
override:
buf.build/cosmos/cosmos-sdk: cosmossdk.io/api
plugins:
- name: go-cosmos-orm-proto
out: .
opt: paths=source_relative

View File

@ -2,9 +2,11 @@ package codegen
import (
"fmt"
"os"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/pluginpb"
ormv1 "cosmossdk.io/api/cosmos/orm/v1"
"github.com/cosmos/cosmos-proto/generator"
@ -17,7 +19,8 @@ const (
ormTablePkg = protogen.GoImportPath("github.com/cosmos/cosmos-sdk/orm/model/ormtable")
)
func PluginRunner(p *protogen.Plugin) error {
func ORMPluginRunner(p *protogen.Plugin) error {
p.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
for _, f := range p.Files {
if !f.Generate {
continue
@ -32,12 +35,42 @@ func PluginRunner(p *protogen.Plugin) error {
GeneratedFile: gen,
LocalPackages: map[string]bool{},
}
f := fileGen{GeneratedFile: cgen, file: f}
err := f.gen()
fgen := fileGen{GeneratedFile: cgen, file: f}
err := fgen.gen()
if err != nil {
return err
}
}
return nil
}
func QueryProtoPluginRunner(p *protogen.Plugin) error {
p.SupportedFeatures = uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)
for _, f := range p.Files {
if !f.Generate {
continue
}
if !hasTables(f) {
continue
}
out, err := os.OpenFile(fmt.Sprintf("%s_query.proto", f.GeneratedFilenamePrefix), os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0644)
if err != nil {
return err
}
err = queryProtoGen{
File: f,
svc: newWriter(),
msgs: newWriter(),
outFile: out,
imports: map[string]bool{},
}.gen()
if err != nil {
return err
}
}
return nil

View File

@ -87,7 +87,11 @@ func (f fileGen) storeStructName() string {
}
func (f fileGen) fileShortName() string {
filename := f.file.Proto.GetName()
return fileShortName(f.file)
}
func fileShortName(file *protogen.File) string {
filename := file.Proto.GetName()
shortName := filepath.Base(filename)
i := strings.Index(shortName, ".")
if i > 0 {
@ -155,7 +159,7 @@ func (f fileGen) genStoreConstructor(stores []*protogen.Message) {
f.P("}")
}
func (f fileGen) fieldsToCamelCase(fields string) string {
func fieldsToCamelCase(fields string) string {
splitFields := strings.Split(fields, ",")
camelFields := make([]string, len(splitFields))
for i, field := range splitFields {
@ -163,3 +167,12 @@ func (f fileGen) fieldsToCamelCase(fields string) string {
}
return strings.Join(camelFields, "")
}
func fieldsToSnakeCase(fields string) string {
splitFields := strings.Split(fields, ",")
camelFields := make([]string, len(splitFields))
for i, field := range splitFields {
camelFields[i] = strcase.ToSnake(field)
}
return strings.Join(camelFields, "_")
}

View File

@ -0,0 +1,319 @@
package codegen
import (
"bytes"
"fmt"
"os"
ormv1 "cosmossdk.io/api/cosmos/orm/v1"
"github.com/iancoleman/strcase"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
)
type queryProtoGen struct {
*protogen.File
imports map[string]bool
svc *writer
msgs *writer
outFile *os.File
}
func (g queryProtoGen) gen() error {
g.imports[g.Desc.Path()] = true
g.svc.F("// %s queries the state of the tables specified by %s.", g.queryServiceName(), g.Desc.Path())
g.svc.F("service %s {", g.queryServiceName())
g.svc.Indent()
for _, msg := range g.Messages {
tableDesc := proto.GetExtension(msg.Desc.Options(), ormv1.E_Table).(*ormv1.TableDescriptor)
if tableDesc != nil {
err := g.genTableRPCMethods(msg, tableDesc)
if err != nil {
return err
}
}
singletonDesc := proto.GetExtension(msg.Desc.Options(), ormv1.E_Singleton).(*ormv1.SingletonDescriptor)
if singletonDesc != nil {
err := g.genSingletonRPCMethods(msg)
if err != nil {
return err
}
}
}
g.svc.Dedent()
g.svc.F("}")
g.svc.F("")
outBuf := newWriter()
outBuf.F("// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT.")
outBuf.F(`syntax = "proto3";`)
outBuf.F("package %s;", g.Desc.Package())
outBuf.F("")
imports := maps.Keys(g.imports)
slices.Sort(imports)
for _, i := range imports {
outBuf.F(`import "%s";`, i)
}
outBuf.F("")
_, err := outBuf.Write(g.svc.Bytes())
if err != nil {
return err
}
_, err = outBuf.Write(g.msgs.Bytes())
if err != nil {
return err
}
_, err = g.outFile.Write(outBuf.Bytes())
if err != nil {
return err
}
return g.outFile.Close()
}
func (g queryProtoGen) genTableRPCMethods(msg *protogen.Message, desc *ormv1.TableDescriptor) error {
name := msg.Desc.Name()
g.svc.F("// Get queries the %s table by its primary key.", name)
g.svc.F("rpc Get%s (Get%sRequest) returns (Get%sResponse) {}", name, name, name) // TODO grpc gateway
g.startRequestType("Get%sRequest", name)
g.msgs.Indent()
primaryKeyFields := fieldnames.CommaSeparatedFieldNames(desc.PrimaryKey.Fields)
fields := msg.Desc.Fields()
for i, fieldName := range primaryKeyFields.Names() {
field := fields.ByName(fieldName)
if field == nil {
return fmt.Errorf("can't find primary key field %s", fieldName)
}
g.msgs.F("// %s specifies the value of the %s field in the primary key.", fieldName, fieldName)
g.msgs.F("%s %s = %d;", g.fieldType(field), fieldName, i+1)
}
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
g.startResponseType("Get%sResponse", name)
g.msgs.Indent()
g.msgs.F("// value is the response value.")
g.msgs.F("%s value = 1;", name)
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
for _, idx := range desc.Index {
if !idx.Unique {
continue
}
fieldsCamel := fieldsToCamelCase(idx.Fields)
methodName := fmt.Sprintf("Get%sBy%s", name, fieldsCamel)
g.svc.F("// %s queries the %s table by its %s index", methodName, name, fieldsCamel)
g.svc.F("rpc %s (%sRequest) returns (%sResponse) {}", methodName, methodName, methodName) // TODO grpc gateway
g.startRequestType("%sRequest", methodName)
g.msgs.Indent()
fieldNames := fieldnames.CommaSeparatedFieldNames(idx.Fields)
for i, fieldName := range fieldNames.Names() {
field := fields.ByName(fieldName)
if field == nil {
return fmt.Errorf("can't find unique index field %s", fieldName)
}
g.msgs.F("%s %s = %d;", g.fieldType(field), fieldName, i+1)
}
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
g.startResponseType("%sResponse", methodName)
g.msgs.Indent()
g.msgs.F("%s value = 1;", name)
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
}
g.imports["cosmos/base/query/v1beta1/pagination.proto"] = true
g.svc.F("// List%s queries the %s table using prefix and range queries against defined indexes.", name, name)
g.svc.F("rpc List%s (List%sRequest) returns (List%sResponse) {}", name, name, name) // TODO grpc gateway
g.startRequestType("List%sRequest", name)
g.msgs.Indent()
g.msgs.F("// IndexKey specifies the value of an index key to use in prefix and range queries.")
g.msgs.F("message IndexKey {")
g.msgs.Indent()
indexFields := []string{desc.PrimaryKey.Fields}
// the primary key has field number 1
fieldNums := []uint32{1}
for _, index := range desc.Index {
indexFields = append(indexFields, index.Fields)
// index field numbers are their id + 1
fieldNums = append(fieldNums, index.Id+1)
}
g.msgs.F("// key specifies the index key value.")
g.msgs.F("oneof key {")
g.msgs.Indent()
for i, fields := range indexFields {
fieldName := fieldsToSnakeCase(fields)
typeName := fieldsToCamelCase(fields)
g.msgs.F("// %s specifies the value of the %s index key to use in the query.", fieldName, typeName)
g.msgs.F("%s %s = %d;", typeName, fieldName, fieldNums[i])
}
g.msgs.Dedent()
g.msgs.F("}")
for _, fieldNames := range indexFields {
g.msgs.F("")
g.msgs.F("message %s {", fieldsToCamelCase(fieldNames))
g.msgs.Indent()
for i, fieldName := range fieldnames.CommaSeparatedFieldNames(fieldNames).Names() {
g.msgs.F("// %s is the value of the %s field in the index.", fieldName, fieldName)
g.msgs.F("// It can be omitted to query for all valid values of that field in this segment of the index.")
g.msgs.F("optional %s %s = %d;", g.fieldType(fields.ByName(fieldName)), fieldName, i+1)
}
g.msgs.Dedent()
g.msgs.F("}")
}
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
g.msgs.F("// query specifies the type of query - either a prefix or range query.")
g.msgs.F("oneof query {")
g.msgs.Indent()
g.msgs.F("// prefix_query specifies the index key value to use for the prefix query.")
g.msgs.F("IndexKey prefix_query = 1;")
g.msgs.F("// range_query specifies the index key from/to values to use for the range query.")
g.msgs.F("RangeQuery range_query = 2;")
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("// pagination specifies optional pagination parameters.")
g.msgs.F("cosmos.base.query.v1beta1.PageRequest pagination = 3;")
g.msgs.F("")
g.msgs.F("// RangeQuery specifies the from/to index keys for a range query.")
g.msgs.F("message RangeQuery {")
g.msgs.Indent()
g.msgs.F("// from is the index key to use for the start of the range query.")
g.msgs.F("// To query from the start of an index, specify an index key for that index with empty values.")
g.msgs.F("IndexKey from = 1;")
g.msgs.F("// to is the index key to use for the end of the range query.")
g.msgs.F("// The index key type MUST be the same as the index key type used for from.")
g.msgs.F("// To query from to the end of an index it can be omitted.")
g.msgs.F("IndexKey to = 2;")
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
g.startResponseType("List%sResponse", name)
g.msgs.Indent()
g.msgs.F("// values are the results of the query.")
g.msgs.F("repeated %s values = 1;", name)
g.msgs.F("// pagination is the pagination response.")
g.msgs.F("cosmos.base.query.v1beta1.PageResponse pagination = 2;")
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
return nil
}
func (g queryProtoGen) genSingletonRPCMethods(msg *protogen.Message) error {
name := msg.Desc.Name()
g.svc.F("// Get%s queries the %s singleton.", name, name)
g.svc.F("rpc Get%s (Get%sRequest) returns (Get%sResponse) {}", name, name, name) // TODO grpc gateway
g.startRequestType("Get%sRequest", name)
g.msgs.F("}")
g.msgs.F("")
g.startRequestType("Get%sResponse", name)
g.msgs.Indent()
g.msgs.F("%s value = 1;", name)
g.msgs.Dedent()
g.msgs.F("}")
g.msgs.F("")
return nil
}
func (g queryProtoGen) startRequestType(format string, args ...any) {
g.startRequestResponseType("request", format, args...)
}
func (g queryProtoGen) startResponseType(format string, args ...any) {
g.startRequestResponseType("response", format, args...)
}
func (g queryProtoGen) startRequestResponseType(typ string, format string, args ...any) {
msgTypeName := fmt.Sprintf(format, args...)
g.msgs.F("// %s is the %s/%s %s type.", msgTypeName, g.queryServiceName(), msgTypeName, typ)
g.msgs.F("message %s {", msgTypeName)
}
func (g queryProtoGen) queryServiceName() string {
return fmt.Sprintf("%sQuery", strcase.ToCamel(fileShortName(g.File)))
}
func (g queryProtoGen) fieldType(descriptor protoreflect.FieldDescriptor) string {
if descriptor.Kind() == protoreflect.MessageKind {
message := descriptor.Message()
g.imports[message.ParentFile().Path()] = true
return string(message.FullName())
}
return descriptor.Kind().String()
}
type writer struct {
*bytes.Buffer
indent int
indentStr string
}
func newWriter() *writer {
return &writer{
Buffer: &bytes.Buffer{},
}
}
func (w *writer) F(format string, args ...interface{}) {
_, err := w.Write([]byte(w.indentStr))
if err != nil {
panic(err)
}
_, err = fmt.Fprintf(w, format, args...)
if err != nil {
panic(err)
}
_, err = fmt.Fprintln(w)
if err != nil {
panic(err)
}
}
func (w *writer) Indent() {
w.indent += 1
w.updateIndent()
}
func (w *writer) updateIndent() {
w.indentStr = ""
for i := 0; i < w.indent; i++ {
w.indentStr += " "
}
}
func (w *writer) Dedent() {
w.indent -= 1
w.updateIndent()
}

View File

@ -61,7 +61,7 @@ func (t tableGen) getTableInterface() {
t.P("type ", t.messageTableInterfaceName(t.msg), " interface {")
t.P("Insert(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error")
if t.table.PrimaryKey.AutoIncrement {
t.P("InsertReturning", t.fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") (uint64, error)")
t.P("InsertReturning", fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") (uint64, error)")
}
t.P("Update(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error")
t.P("Save(ctx ", contextPkg.Ident("Context"), ", ", t.param(t.msg.GoIdent.GoName), " *", t.QualifiedGoIdent(t.msg.GoIdent), ") error")
@ -86,7 +86,7 @@ func (t tableGen) getTableInterface() {
// returns the has and get (in that order) function signature for unique indexes.
func (t tableGen) uniqueIndexSig(idxFields string) (string, string, string) {
fieldsSlc := strings.Split(idxFields, ",")
camelFields := t.fieldsToCamelCase(idxFields)
camelFields := fieldsToCamelCase(idxFields)
hasFuncName := "HasBy" + camelFields
getFuncName := "GetBy" + camelFields
@ -180,7 +180,7 @@ func (t tableGen) genTableImpl() {
}
if t.table.PrimaryKey.AutoIncrement {
t.P(receiver, "InsertReturning", t.fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", varTypeName, ") (uint64, error) {")
t.P(receiver, "InsertReturning", fieldsToCamelCase(t.table.PrimaryKey.Fields), "(ctx ", contextPkg.Ident("Context"), ", ", varName, " *", varTypeName, ") (uint64, error) {")
t.P("return ", receiverVar, ".table.InsertReturningPKey(ctx, ", varName, ")")
t.P("}")
t.P()

View File

@ -4,7 +4,6 @@ package testpb
import (
context "context"
ormlist "github.com/cosmos/cosmos-sdk/orm/model/ormlist"
ormtable "github.com/cosmos/cosmos-sdk/orm/model/ormtable"
ormerrors "github.com/cosmos/cosmos-sdk/orm/types/ormerrors"

View File

@ -0,0 +1,246 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc (unknown)
// source: testpb/bank.proto
package testpb
import (
_ "cosmossdk.io/api/cosmos/orm/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Balance struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"`
Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
}
func (x *Balance) Reset() {
*x = Balance{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_bank_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Balance) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Balance) ProtoMessage() {}
func (x *Balance) ProtoReflect() protoreflect.Message {
mi := &file_testpb_bank_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Balance.ProtoReflect.Descriptor instead.
func (*Balance) Descriptor() ([]byte, []int) {
return file_testpb_bank_proto_rawDescGZIP(), []int{0}
}
func (x *Balance) GetAddress() string {
if x != nil {
return x.Address
}
return ""
}
func (x *Balance) GetDenom() string {
if x != nil {
return x.Denom
}
return ""
}
func (x *Balance) GetAmount() uint64 {
if x != nil {
return x.Amount
}
return 0
}
type Supply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
}
func (x *Supply) Reset() {
*x = Supply{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_bank_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Supply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Supply) ProtoMessage() {}
func (x *Supply) ProtoReflect() protoreflect.Message {
mi := &file_testpb_bank_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Supply.ProtoReflect.Descriptor instead.
func (*Supply) Descriptor() ([]byte, []int) {
return file_testpb_bank_proto_rawDescGZIP(), []int{1}
}
func (x *Supply) GetDenom() string {
if x != nil {
return x.Denom
}
return ""
}
func (x *Supply) GetAmount() uint64 {
if x != nil {
return x.Amount
}
return 0
}
var File_testpb_bank_proto protoreflect.FileDescriptor
var file_testpb_bank_proto_rawDesc = []byte{
0x0a, 0x11, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x1a, 0x17, 0x63, 0x6f, 0x73,
0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x77, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e,
0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12,
0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52,
0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x24, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x1e, 0x0a,
0x0f, 0x0a, 0x0d, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x2c, 0x64, 0x65, 0x6e, 0x6f, 0x6d,
0x12, 0x09, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x10, 0x01, 0x18, 0x01, 0x22, 0x49, 0x0a,
0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x12, 0x16, 0x0a,
0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61,
0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x11, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x0b, 0x0a, 0x07, 0x0a,
0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x42, 0x81, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d,
0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x42, 0x61, 0x6e, 0x6b, 0x50, 0x72, 0x6f,
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73,
0x64, 0x6b, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54,
0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02,
0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_testpb_bank_proto_rawDescOnce sync.Once
file_testpb_bank_proto_rawDescData = file_testpb_bank_proto_rawDesc
)
func file_testpb_bank_proto_rawDescGZIP() []byte {
file_testpb_bank_proto_rawDescOnce.Do(func() {
file_testpb_bank_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_bank_proto_rawDescData)
})
return file_testpb_bank_proto_rawDescData
}
var file_testpb_bank_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_testpb_bank_proto_goTypes = []interface{}{
(*Balance)(nil), // 0: testpb.Balance
(*Supply)(nil), // 1: testpb.Supply
}
var file_testpb_bank_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_testpb_bank_proto_init() }
func file_testpb_bank_proto_init() {
if File_testpb_bank_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_testpb_bank_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Balance); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_testpb_bank_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Supply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_testpb_bank_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_testpb_bank_proto_goTypes,
DependencyIndexes: file_testpb_bank_proto_depIdxs,
MessageInfos: file_testpb_bank_proto_msgTypes,
}.Build()
File_testpb_bank_proto = out.File
file_testpb_bank_proto_rawDesc = nil
file_testpb_bank_proto_goTypes = nil
file_testpb_bank_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,150 @@
// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT.
syntax = "proto3";
package testpb;
import "cosmos/base/query/v1beta1/pagination.proto";
import "testpb/bank.proto";
// BankQuery queries the state of the tables specified by testpb/bank.proto.
service BankQuery {
// Get queries the Balance table by its primary key.
rpc GetBalance (GetBalanceRequest) returns (GetBalanceResponse) {}
// ListBalance queries the Balance table using prefix and range queries against defined indexes.
rpc ListBalance (ListBalanceRequest) returns (ListBalanceResponse) {}
// Get queries the Supply table by its primary key.
rpc GetSupply (GetSupplyRequest) returns (GetSupplyResponse) {}
// ListSupply queries the Supply table using prefix and range queries against defined indexes.
rpc ListSupply (ListSupplyRequest) returns (ListSupplyResponse) {}
}
// GetBalanceRequest is the BankQuery/GetBalanceRequest request type.
message GetBalanceRequest {
// address specifies the value of the address field in the primary key.
string address = 1;
// denom specifies the value of the denom field in the primary key.
string denom = 2;
}
// GetBalanceResponse is the BankQuery/GetBalanceResponse response type.
message GetBalanceResponse {
// value is the response value.
Balance value = 1;
}
// ListBalanceRequest is the BankQuery/ListBalanceRequest request type.
message ListBalanceRequest {
// IndexKey specifies the value of an index key to use in prefix and range queries.
message IndexKey {
// key specifies the index key value.
oneof key {
// address_denom specifies the value of the AddressDenom index key to use in the query.
AddressDenom address_denom = 1;
// denom specifies the value of the Denom index key to use in the query.
Denom denom = 2;
}
message AddressDenom {
// address is the value of the address field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string address = 1;
// denom is the value of the denom field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string denom = 2;
}
message Denom {
// denom is the value of the denom field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string denom = 1;
}
}
// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
IndexKey prefix_query = 1;
// range_query specifies the index key from/to values to use for the range query.
RangeQuery range_query = 2;
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
// To query from the start of an index, specify an index key for that index with empty values.
IndexKey from = 1;
// to is the index key to use for the end of the range query.
// The index key type MUST be the same as the index key type used for from.
// To query from to the end of an index it can be omitted.
IndexKey to = 2;
}
}
// ListBalanceResponse is the BankQuery/ListBalanceResponse response type.
message ListBalanceResponse {
// values are the results of the query.
repeated Balance values = 1;
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetSupplyRequest is the BankQuery/GetSupplyRequest request type.
message GetSupplyRequest {
// denom specifies the value of the denom field in the primary key.
string denom = 1;
}
// GetSupplyResponse is the BankQuery/GetSupplyResponse response type.
message GetSupplyResponse {
// value is the response value.
Supply value = 1;
}
// ListSupplyRequest is the BankQuery/ListSupplyRequest request type.
message ListSupplyRequest {
// IndexKey specifies the value of an index key to use in prefix and range queries.
message IndexKey {
// key specifies the index key value.
oneof key {
// denom specifies the value of the Denom index key to use in the query.
Denom denom = 1;
}
message Denom {
// denom is the value of the denom field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string denom = 1;
}
}
// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
IndexKey prefix_query = 1;
// range_query specifies the index key from/to values to use for the range query.
RangeQuery range_query = 2;
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
// To query from the start of an index, specify an index key for that index with empty values.
IndexKey from = 1;
// to is the index key to use for the end of the range query.
// The index key type MUST be the same as the index key type used for from.
// To query from to the end of an index it can be omitted.
IndexKey to = 2;
}
}
// ListSupplyResponse is the BankQuery/ListSupplyResponse response type.
message ListSupplyResponse {
// values are the results of the query.
repeated Supply values = 1;
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

View File

@ -0,0 +1,221 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: testpb/bank_query.proto
package testpb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// BankQueryClient is the client API for BankQuery service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type BankQueryClient interface {
// Get queries the Balance table by its primary key.
GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error)
// ListBalance queries the Balance table using prefix and range queries against defined indexes.
ListBalance(ctx context.Context, in *ListBalanceRequest, opts ...grpc.CallOption) (*ListBalanceResponse, error)
// Get queries the Supply table by its primary key.
GetSupply(ctx context.Context, in *GetSupplyRequest, opts ...grpc.CallOption) (*GetSupplyResponse, error)
// ListSupply queries the Supply table using prefix and range queries against defined indexes.
ListSupply(ctx context.Context, in *ListSupplyRequest, opts ...grpc.CallOption) (*ListSupplyResponse, error)
}
type bankQueryClient struct {
cc grpc.ClientConnInterface
}
func NewBankQueryClient(cc grpc.ClientConnInterface) BankQueryClient {
return &bankQueryClient{cc}
}
func (c *bankQueryClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) {
out := new(GetBalanceResponse)
err := c.cc.Invoke(ctx, "/testpb.BankQuery/GetBalance", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bankQueryClient) ListBalance(ctx context.Context, in *ListBalanceRequest, opts ...grpc.CallOption) (*ListBalanceResponse, error) {
out := new(ListBalanceResponse)
err := c.cc.Invoke(ctx, "/testpb.BankQuery/ListBalance", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bankQueryClient) GetSupply(ctx context.Context, in *GetSupplyRequest, opts ...grpc.CallOption) (*GetSupplyResponse, error) {
out := new(GetSupplyResponse)
err := c.cc.Invoke(ctx, "/testpb.BankQuery/GetSupply", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *bankQueryClient) ListSupply(ctx context.Context, in *ListSupplyRequest, opts ...grpc.CallOption) (*ListSupplyResponse, error) {
out := new(ListSupplyResponse)
err := c.cc.Invoke(ctx, "/testpb.BankQuery/ListSupply", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BankQueryServer is the server API for BankQuery service.
// All implementations must embed UnimplementedBankQueryServer
// for forward compatibility
type BankQueryServer interface {
// Get queries the Balance table by its primary key.
GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error)
// ListBalance queries the Balance table using prefix and range queries against defined indexes.
ListBalance(context.Context, *ListBalanceRequest) (*ListBalanceResponse, error)
// Get queries the Supply table by its primary key.
GetSupply(context.Context, *GetSupplyRequest) (*GetSupplyResponse, error)
// ListSupply queries the Supply table using prefix and range queries against defined indexes.
ListSupply(context.Context, *ListSupplyRequest) (*ListSupplyResponse, error)
mustEmbedUnimplementedBankQueryServer()
}
// UnimplementedBankQueryServer must be embedded to have forward compatible implementations.
type UnimplementedBankQueryServer struct {
}
func (UnimplementedBankQueryServer) GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetBalance not implemented")
}
func (UnimplementedBankQueryServer) ListBalance(context.Context, *ListBalanceRequest) (*ListBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListBalance not implemented")
}
func (UnimplementedBankQueryServer) GetSupply(context.Context, *GetSupplyRequest) (*GetSupplyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSupply not implemented")
}
func (UnimplementedBankQueryServer) ListSupply(context.Context, *ListSupplyRequest) (*ListSupplyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSupply not implemented")
}
func (UnimplementedBankQueryServer) mustEmbedUnimplementedBankQueryServer() {}
// UnsafeBankQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BankQueryServer will
// result in compilation errors.
type UnsafeBankQueryServer interface {
mustEmbedUnimplementedBankQueryServer()
}
func RegisterBankQueryServer(s grpc.ServiceRegistrar, srv BankQueryServer) {
s.RegisterService(&BankQuery_ServiceDesc, srv)
}
func _BankQuery_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BankQueryServer).GetBalance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.BankQuery/GetBalance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BankQueryServer).GetBalance(ctx, req.(*GetBalanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BankQuery_ListBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BankQueryServer).ListBalance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.BankQuery/ListBalance",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BankQueryServer).ListBalance(ctx, req.(*ListBalanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BankQuery_GetSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSupplyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BankQueryServer).GetSupply(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.BankQuery/GetSupply",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BankQueryServer).GetSupply(ctx, req.(*GetSupplyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BankQuery_ListSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListSupplyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BankQueryServer).ListSupply(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.BankQuery/ListSupply",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BankQueryServer).ListSupply(ctx, req.(*ListSupplyRequest))
}
return interceptor(ctx, in, info, handler)
}
// BankQuery_ServiceDesc is the grpc.ServiceDesc for BankQuery service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BankQuery_ServiceDesc = grpc.ServiceDesc{
ServiceName: "testpb.BankQuery",
HandlerType: (*BankQueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetBalance",
Handler: _BankQuery_GetBalance_Handler,
},
{
MethodName: "ListBalance",
Handler: _BankQuery_ListBalance_Handler,
},
{
MethodName: "GetSupply",
Handler: _BankQuery_GetSupply_Handler,
},
{
MethodName: "ListSupply",
Handler: _BankQuery_ListSupply_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "testpb/bank_query.proto",
}

View File

@ -4,7 +4,6 @@ package testpb
import (
context "context"
ormlist "github.com/cosmos/cosmos-sdk/orm/model/ormlist"
ormtable "github.com/cosmos/cosmos-sdk/orm/model/ormtable"
ormerrors "github.com/cosmos/cosmos-sdk/orm/types/ormerrors"

View File

@ -0,0 +1,914 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc (unknown)
// source: testpb/test_schema.proto
package testpb
import (
_ "cosmossdk.io/api/cosmos/orm/v1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Enum int32
const (
Enum_ENUM_UNSPECIFIED Enum = 0
Enum_ENUM_ONE Enum = 1
Enum_ENUM_TWO Enum = 2
Enum_ENUM_FIVE Enum = 5
Enum_ENUM_NEG_THREE Enum = -3
)
// Enum value maps for Enum.
var (
Enum_name = map[int32]string{
0: "ENUM_UNSPECIFIED",
1: "ENUM_ONE",
2: "ENUM_TWO",
5: "ENUM_FIVE",
-3: "ENUM_NEG_THREE",
}
Enum_value = map[string]int32{
"ENUM_UNSPECIFIED": 0,
"ENUM_ONE": 1,
"ENUM_TWO": 2,
"ENUM_FIVE": 5,
"ENUM_NEG_THREE": -3,
}
)
func (x Enum) Enum() *Enum {
p := new(Enum)
*p = x
return p
}
func (x Enum) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Enum) Descriptor() protoreflect.EnumDescriptor {
return file_testpb_test_schema_proto_enumTypes[0].Descriptor()
}
func (Enum) Type() protoreflect.EnumType {
return &file_testpb_test_schema_proto_enumTypes[0]
}
func (x Enum) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use Enum.Descriptor instead.
func (Enum) EnumDescriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{0}
}
type ExampleTable struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Valid key fields:
U32 uint32 `protobuf:"varint,1,opt,name=u32,proto3" json:"u32,omitempty"`
U64 uint64 `protobuf:"varint,2,opt,name=u64,proto3" json:"u64,omitempty"`
Str string `protobuf:"bytes,3,opt,name=str,proto3" json:"str,omitempty"`
Bz []byte `protobuf:"bytes,4,opt,name=bz,proto3" json:"bz,omitempty"`
Ts *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=ts,proto3" json:"ts,omitempty"`
Dur *durationpb.Duration `protobuf:"bytes,6,opt,name=dur,proto3" json:"dur,omitempty"`
I32 int32 `protobuf:"varint,7,opt,name=i32,proto3" json:"i32,omitempty"`
S32 int32 `protobuf:"zigzag32,8,opt,name=s32,proto3" json:"s32,omitempty"`
Sf32 int32 `protobuf:"fixed32,9,opt,name=sf32,proto3" json:"sf32,omitempty"`
I64 int64 `protobuf:"varint,10,opt,name=i64,proto3" json:"i64,omitempty"`
S64 int64 `protobuf:"zigzag64,11,opt,name=s64,proto3" json:"s64,omitempty"`
Sf64 int64 `protobuf:"fixed64,12,opt,name=sf64,proto3" json:"sf64,omitempty"`
F32 uint32 `protobuf:"fixed32,13,opt,name=f32,proto3" json:"f32,omitempty"`
F64 uint64 `protobuf:"fixed64,14,opt,name=f64,proto3" json:"f64,omitempty"`
B bool `protobuf:"varint,15,opt,name=b,proto3" json:"b,omitempty"`
E Enum `protobuf:"varint,16,opt,name=e,proto3,enum=testpb.Enum" json:"e,omitempty"`
// Invalid key fields:
Repeated []uint32 `protobuf:"varint,17,rep,packed,name=repeated,proto3" json:"repeated,omitempty"`
Map map[string]uint32 `protobuf:"bytes,18,rep,name=map,proto3" json:"map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
Msg *ExampleTable_ExampleMessage `protobuf:"bytes,19,opt,name=msg,proto3" json:"msg,omitempty"`
// Types that are assignable to Sum:
// *ExampleTable_Oneof
Sum isExampleTable_Sum `protobuf_oneof:"sum"`
}
func (x *ExampleTable) Reset() {
*x = ExampleTable{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_test_schema_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExampleTable) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExampleTable) ProtoMessage() {}
func (x *ExampleTable) ProtoReflect() protoreflect.Message {
mi := &file_testpb_test_schema_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExampleTable.ProtoReflect.Descriptor instead.
func (*ExampleTable) Descriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{0}
}
func (x *ExampleTable) GetU32() uint32 {
if x != nil {
return x.U32
}
return 0
}
func (x *ExampleTable) GetU64() uint64 {
if x != nil {
return x.U64
}
return 0
}
func (x *ExampleTable) GetStr() string {
if x != nil {
return x.Str
}
return ""
}
func (x *ExampleTable) GetBz() []byte {
if x != nil {
return x.Bz
}
return nil
}
func (x *ExampleTable) GetTs() *timestamppb.Timestamp {
if x != nil {
return x.Ts
}
return nil
}
func (x *ExampleTable) GetDur() *durationpb.Duration {
if x != nil {
return x.Dur
}
return nil
}
func (x *ExampleTable) GetI32() int32 {
if x != nil {
return x.I32
}
return 0
}
func (x *ExampleTable) GetS32() int32 {
if x != nil {
return x.S32
}
return 0
}
func (x *ExampleTable) GetSf32() int32 {
if x != nil {
return x.Sf32
}
return 0
}
func (x *ExampleTable) GetI64() int64 {
if x != nil {
return x.I64
}
return 0
}
func (x *ExampleTable) GetS64() int64 {
if x != nil {
return x.S64
}
return 0
}
func (x *ExampleTable) GetSf64() int64 {
if x != nil {
return x.Sf64
}
return 0
}
func (x *ExampleTable) GetF32() uint32 {
if x != nil {
return x.F32
}
return 0
}
func (x *ExampleTable) GetF64() uint64 {
if x != nil {
return x.F64
}
return 0
}
func (x *ExampleTable) GetB() bool {
if x != nil {
return x.B
}
return false
}
func (x *ExampleTable) GetE() Enum {
if x != nil {
return x.E
}
return Enum_ENUM_UNSPECIFIED
}
func (x *ExampleTable) GetRepeated() []uint32 {
if x != nil {
return x.Repeated
}
return nil
}
func (x *ExampleTable) GetMap() map[string]uint32 {
if x != nil {
return x.Map
}
return nil
}
func (x *ExampleTable) GetMsg() *ExampleTable_ExampleMessage {
if x != nil {
return x.Msg
}
return nil
}
func (m *ExampleTable) GetSum() isExampleTable_Sum {
if m != nil {
return m.Sum
}
return nil
}
func (x *ExampleTable) GetOneof() uint32 {
if x, ok := x.GetSum().(*ExampleTable_Oneof); ok {
return x.Oneof
}
return 0
}
type isExampleTable_Sum interface {
isExampleTable_Sum()
}
type ExampleTable_Oneof struct {
Oneof uint32 `protobuf:"varint,20,opt,name=oneof,proto3,oneof"`
}
func (*ExampleTable_Oneof) isExampleTable_Sum() {}
type ExampleAutoIncrementTable struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
X string `protobuf:"bytes,2,opt,name=x,proto3" json:"x,omitempty"`
Y int32 `protobuf:"varint,3,opt,name=y,proto3" json:"y,omitempty"`
}
func (x *ExampleAutoIncrementTable) Reset() {
*x = ExampleAutoIncrementTable{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_test_schema_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExampleAutoIncrementTable) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExampleAutoIncrementTable) ProtoMessage() {}
func (x *ExampleAutoIncrementTable) ProtoReflect() protoreflect.Message {
mi := &file_testpb_test_schema_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExampleAutoIncrementTable.ProtoReflect.Descriptor instead.
func (*ExampleAutoIncrementTable) Descriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{1}
}
func (x *ExampleAutoIncrementTable) GetId() uint64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ExampleAutoIncrementTable) GetX() string {
if x != nil {
return x.X
}
return ""
}
func (x *ExampleAutoIncrementTable) GetY() int32 {
if x != nil {
return x.Y
}
return 0
}
type ExampleSingleton struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"`
Bar int32 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"`
}
func (x *ExampleSingleton) Reset() {
*x = ExampleSingleton{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_test_schema_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExampleSingleton) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExampleSingleton) ProtoMessage() {}
func (x *ExampleSingleton) ProtoReflect() protoreflect.Message {
mi := &file_testpb_test_schema_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExampleSingleton.ProtoReflect.Descriptor instead.
func (*ExampleSingleton) Descriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{2}
}
func (x *ExampleSingleton) GetFoo() string {
if x != nil {
return x.Foo
}
return ""
}
func (x *ExampleSingleton) GetBar() int32 {
if x != nil {
return x.Bar
}
return 0
}
type ExampleTimestamp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Ts *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=ts,proto3" json:"ts,omitempty"`
}
func (x *ExampleTimestamp) Reset() {
*x = ExampleTimestamp{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_test_schema_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExampleTimestamp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExampleTimestamp) ProtoMessage() {}
func (x *ExampleTimestamp) ProtoReflect() protoreflect.Message {
mi := &file_testpb_test_schema_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExampleTimestamp.ProtoReflect.Descriptor instead.
func (*ExampleTimestamp) Descriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{3}
}
func (x *ExampleTimestamp) GetId() uint64 {
if x != nil {
return x.Id
}
return 0
}
func (x *ExampleTimestamp) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ExampleTimestamp) GetTs() *timestamppb.Timestamp {
if x != nil {
return x.Ts
}
return nil
}
type SimpleExample struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Unique string `protobuf:"bytes,2,opt,name=unique,proto3" json:"unique,omitempty"`
NotUnique string `protobuf:"bytes,3,opt,name=not_unique,json=notUnique,proto3" json:"not_unique,omitempty"`
}
func (x *SimpleExample) Reset() {
*x = SimpleExample{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_test_schema_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SimpleExample) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SimpleExample) ProtoMessage() {}
func (x *SimpleExample) ProtoReflect() protoreflect.Message {
mi := &file_testpb_test_schema_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SimpleExample.ProtoReflect.Descriptor instead.
func (*SimpleExample) Descriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{4}
}
func (x *SimpleExample) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *SimpleExample) GetUnique() string {
if x != nil {
return x.Unique
}
return ""
}
func (x *SimpleExample) GetNotUnique() string {
if x != nil {
return x.NotUnique
}
return ""
}
// ExampleAutoIncFieldName is a table for testing InsertReturning<FieldName>.
type ExampleAutoIncFieldName struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Foo uint64 `protobuf:"varint,1,opt,name=foo,proto3" json:"foo,omitempty"`
Bar uint64 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"`
}
func (x *ExampleAutoIncFieldName) Reset() {
*x = ExampleAutoIncFieldName{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_test_schema_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExampleAutoIncFieldName) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExampleAutoIncFieldName) ProtoMessage() {}
func (x *ExampleAutoIncFieldName) ProtoReflect() protoreflect.Message {
mi := &file_testpb_test_schema_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExampleAutoIncFieldName.ProtoReflect.Descriptor instead.
func (*ExampleAutoIncFieldName) Descriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{5}
}
func (x *ExampleAutoIncFieldName) GetFoo() uint64 {
if x != nil {
return x.Foo
}
return 0
}
func (x *ExampleAutoIncFieldName) GetBar() uint64 {
if x != nil {
return x.Bar
}
return 0
}
type ExampleTable_ExampleMessage struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Foo string `protobuf:"bytes,1,opt,name=foo,proto3" json:"foo,omitempty"`
Bar int32 `protobuf:"varint,2,opt,name=bar,proto3" json:"bar,omitempty"`
}
func (x *ExampleTable_ExampleMessage) Reset() {
*x = ExampleTable_ExampleMessage{}
if protoimpl.UnsafeEnabled {
mi := &file_testpb_test_schema_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ExampleTable_ExampleMessage) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ExampleTable_ExampleMessage) ProtoMessage() {}
func (x *ExampleTable_ExampleMessage) ProtoReflect() protoreflect.Message {
mi := &file_testpb_test_schema_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ExampleTable_ExampleMessage.ProtoReflect.Descriptor instead.
func (*ExampleTable_ExampleMessage) Descriptor() ([]byte, []int) {
return file_testpb_test_schema_proto_rawDescGZIP(), []int{0, 1}
}
func (x *ExampleTable_ExampleMessage) GetFoo() string {
if x != nil {
return x.Foo
}
return ""
}
func (x *ExampleTable_ExampleMessage) GetBar() int32 {
if x != nil {
return x.Bar
}
return 0
}
var File_testpb_test_schema_proto protoreflect.FileDescriptor
var file_testpb_test_schema_proto_rawDesc = []byte{
0x0a, 0x18, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x63,
0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x74, 0x65, 0x73, 0x74,
0x70, 0x62, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f,
0x76, 0x31, 0x2f, 0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x05, 0x0a,
0x0c, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x33, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x75, 0x33, 0x32, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x75, 0x36,
0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x74, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x73, 0x74, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x62, 0x7a, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52,
0x02, 0x62, 0x7a, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, 0x12,
0x2b, 0x0a, 0x03, 0x64, 0x75, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44,
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x03, 0x64, 0x75, 0x72, 0x12, 0x10, 0x0a, 0x03,
0x69, 0x33, 0x32, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x69, 0x33, 0x32, 0x12, 0x10,
0x0a, 0x03, 0x73, 0x33, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x11, 0x52, 0x03, 0x73, 0x33, 0x32,
0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x33, 0x32, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0f, 0x52, 0x04,
0x73, 0x66, 0x33, 0x32, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x36, 0x34, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x03, 0x52, 0x03, 0x69, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x36, 0x34, 0x18, 0x0b, 0x20,
0x01, 0x28, 0x12, 0x52, 0x03, 0x73, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34,
0x18, 0x0c, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, 0x36, 0x34, 0x12, 0x10, 0x0a, 0x03,
0x66, 0x33, 0x32, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x07, 0x52, 0x03, 0x66, 0x33, 0x32, 0x12, 0x10,
0x0a, 0x03, 0x66, 0x36, 0x34, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x06, 0x52, 0x03, 0x66, 0x36, 0x34,
0x12, 0x0c, 0x0a, 0x01, 0x62, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x01, 0x62, 0x12, 0x1a,
0x0a, 0x01, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x74, 0x65, 0x73, 0x74,
0x70, 0x62, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x01, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65,
0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65,
0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x12, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x12, 0x35, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x13,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x16,
0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52,
0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x1a, 0x36, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x34,
0x0a, 0x0e, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66,
0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x03, 0x62, 0x61, 0x72, 0x3a, 0x3f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x39, 0x0a, 0x0d, 0x0a, 0x0b,
0x75, 0x33, 0x32, 0x2c, 0x69, 0x36, 0x34, 0x2c, 0x73, 0x74, 0x72, 0x12, 0x0d, 0x0a, 0x07, 0x75,
0x36, 0x34, 0x2c, 0x73, 0x74, 0x72, 0x10, 0x01, 0x18, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x73, 0x74,
0x72, 0x2c, 0x75, 0x33, 0x32, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x62, 0x7a, 0x2c, 0x73, 0x74,
0x72, 0x10, 0x03, 0x18, 0x01, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x62, 0x0a, 0x19,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x72, 0x65,
0x6d, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x03, 0x20, 0x01,
0x28, 0x05, 0x52, 0x01, 0x79, 0x3a, 0x19, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x13, 0x0a, 0x06, 0x0a,
0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x01, 0x78, 0x10, 0x01, 0x18, 0x01, 0x18, 0x03,
0x22, 0x40, 0x0a, 0x10, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x6e, 0x67, 0x6c,
0x65, 0x74, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x08, 0xfa, 0x9e, 0xd3, 0x8e, 0x03, 0x02,
0x08, 0x02, 0x22, 0x7c, 0x0a, 0x10, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x54, 0x69, 0x6d,
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x02, 0x74, 0x73,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
0x6d, 0x70, 0x52, 0x02, 0x74, 0x73, 0x3a, 0x18, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x12, 0x0a, 0x06,
0x0a, 0x02, 0x69, 0x64, 0x10, 0x01, 0x12, 0x06, 0x0a, 0x02, 0x74, 0x73, 0x10, 0x01, 0x18, 0x04,
0x22, 0x7a, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x12, 0x1d, 0x0a,
0x0a, 0x6e, 0x6f, 0x74, 0x5f, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x6e, 0x6f, 0x74, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x3a, 0x1e, 0xf2, 0x9e,
0xd3, 0x8e, 0x03, 0x18, 0x0a, 0x06, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0c, 0x0a, 0x06,
0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x10, 0x01, 0x18, 0x01, 0x18, 0x05, 0x22, 0x50, 0x0a, 0x17,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63, 0x46, 0x69,
0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72,
0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x11, 0xf2, 0x9e, 0xd3,
0x8e, 0x03, 0x0b, 0x0a, 0x07, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x10, 0x01, 0x18, 0x06, 0x2a, 0x64,
0x0a, 0x04, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x55,
0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08,
0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x4e,
0x55, 0x4d, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d,
0x5f, 0x46, 0x49, 0x56, 0x45, 0x10, 0x05, 0x12, 0x1b, 0x0a, 0x0e, 0x45, 0x4e, 0x55, 0x4d, 0x5f,
0x4e, 0x45, 0x47, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x01, 0x42, 0x87, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73,
0x74, 0x70, 0x62, 0x42, 0x0f, 0x54, 0x65, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50,
0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73,
0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61,
0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02,
0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62,
0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74,
0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_testpb_test_schema_proto_rawDescOnce sync.Once
file_testpb_test_schema_proto_rawDescData = file_testpb_test_schema_proto_rawDesc
)
func file_testpb_test_schema_proto_rawDescGZIP() []byte {
file_testpb_test_schema_proto_rawDescOnce.Do(func() {
file_testpb_test_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_testpb_test_schema_proto_rawDescData)
})
return file_testpb_test_schema_proto_rawDescData
}
var file_testpb_test_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_testpb_test_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_testpb_test_schema_proto_goTypes = []interface{}{
(Enum)(0), // 0: testpb.Enum
(*ExampleTable)(nil), // 1: testpb.ExampleTable
(*ExampleAutoIncrementTable)(nil), // 2: testpb.ExampleAutoIncrementTable
(*ExampleSingleton)(nil), // 3: testpb.ExampleSingleton
(*ExampleTimestamp)(nil), // 4: testpb.ExampleTimestamp
(*SimpleExample)(nil), // 5: testpb.SimpleExample
(*ExampleAutoIncFieldName)(nil), // 6: testpb.ExampleAutoIncFieldName
nil, // 7: testpb.ExampleTable.MapEntry
(*ExampleTable_ExampleMessage)(nil), // 8: testpb.ExampleTable.ExampleMessage
(*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp
(*durationpb.Duration)(nil), // 10: google.protobuf.Duration
}
var file_testpb_test_schema_proto_depIdxs = []int32{
9, // 0: testpb.ExampleTable.ts:type_name -> google.protobuf.Timestamp
10, // 1: testpb.ExampleTable.dur:type_name -> google.protobuf.Duration
0, // 2: testpb.ExampleTable.e:type_name -> testpb.Enum
7, // 3: testpb.ExampleTable.map:type_name -> testpb.ExampleTable.MapEntry
8, // 4: testpb.ExampleTable.msg:type_name -> testpb.ExampleTable.ExampleMessage
9, // 5: testpb.ExampleTimestamp.ts:type_name -> google.protobuf.Timestamp
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_testpb_test_schema_proto_init() }
func file_testpb_test_schema_proto_init() {
if File_testpb_test_schema_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_testpb_test_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExampleTable); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_testpb_test_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExampleAutoIncrementTable); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_testpb_test_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExampleSingleton); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_testpb_test_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExampleTimestamp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_testpb_test_schema_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SimpleExample); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_testpb_test_schema_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExampleAutoIncFieldName); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_testpb_test_schema_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ExampleTable_ExampleMessage); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_testpb_test_schema_proto_msgTypes[0].OneofWrappers = []interface{}{
(*ExampleTable_Oneof)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_testpb_test_schema_proto_rawDesc,
NumEnums: 1,
NumMessages: 8,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_testpb_test_schema_proto_goTypes,
DependencyIndexes: file_testpb_test_schema_proto_depIdxs,
EnumInfos: file_testpb_test_schema_proto_enumTypes,
MessageInfos: file_testpb_test_schema_proto_msgTypes,
}.Build()
File_testpb_test_schema_proto = out.File
file_testpb_test_schema_proto_rawDesc = nil
file_testpb_test_schema_proto_goTypes = nil
file_testpb_test_schema_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,442 @@
// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT.
syntax = "proto3";
package testpb;
import "cosmos/base/query/v1beta1/pagination.proto";
import "google/protobuf/timestamp.proto";
import "testpb/test_schema.proto";
// TestSchemaQuery queries the state of the tables specified by testpb/test_schema.proto.
service TestSchemaQuery {
// Get queries the ExampleTable table by its primary key.
rpc GetExampleTable (GetExampleTableRequest) returns (GetExampleTableResponse) {}
// GetExampleTableByU64Str queries the ExampleTable table by its U64Str index
rpc GetExampleTableByU64Str (GetExampleTableByU64StrRequest) returns (GetExampleTableByU64StrResponse) {}
// ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes.
rpc ListExampleTable (ListExampleTableRequest) returns (ListExampleTableResponse) {}
// Get queries the ExampleAutoIncrementTable table by its primary key.
rpc GetExampleAutoIncrementTable (GetExampleAutoIncrementTableRequest) returns (GetExampleAutoIncrementTableResponse) {}
// GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index
rpc GetExampleAutoIncrementTableByX (GetExampleAutoIncrementTableByXRequest) returns (GetExampleAutoIncrementTableByXResponse) {}
// ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes.
rpc ListExampleAutoIncrementTable (ListExampleAutoIncrementTableRequest) returns (ListExampleAutoIncrementTableResponse) {}
// GetExampleSingleton queries the ExampleSingleton singleton.
rpc GetExampleSingleton (GetExampleSingletonRequest) returns (GetExampleSingletonResponse) {}
// Get queries the ExampleTimestamp table by its primary key.
rpc GetExampleTimestamp (GetExampleTimestampRequest) returns (GetExampleTimestampResponse) {}
// ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes.
rpc ListExampleTimestamp (ListExampleTimestampRequest) returns (ListExampleTimestampResponse) {}
// Get queries the SimpleExample table by its primary key.
rpc GetSimpleExample (GetSimpleExampleRequest) returns (GetSimpleExampleResponse) {}
// GetSimpleExampleByUnique queries the SimpleExample table by its Unique index
rpc GetSimpleExampleByUnique (GetSimpleExampleByUniqueRequest) returns (GetSimpleExampleByUniqueResponse) {}
// ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes.
rpc ListSimpleExample (ListSimpleExampleRequest) returns (ListSimpleExampleResponse) {}
// Get queries the ExampleAutoIncFieldName table by its primary key.
rpc GetExampleAutoIncFieldName (GetExampleAutoIncFieldNameRequest) returns (GetExampleAutoIncFieldNameResponse) {}
// ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes.
rpc ListExampleAutoIncFieldName (ListExampleAutoIncFieldNameRequest) returns (ListExampleAutoIncFieldNameResponse) {}
}
// GetExampleTableRequest is the TestSchemaQuery/GetExampleTableRequest request type.
message GetExampleTableRequest {
// u32 specifies the value of the u32 field in the primary key.
uint32 u32 = 1;
// i64 specifies the value of the i64 field in the primary key.
int64 i64 = 2;
// str specifies the value of the str field in the primary key.
string str = 3;
}
// GetExampleTableResponse is the TestSchemaQuery/GetExampleTableResponse response type.
message GetExampleTableResponse {
// value is the response value.
ExampleTable value = 1;
}
// GetExampleTableByU64StrRequest is the TestSchemaQuery/GetExampleTableByU64StrRequest request type.
message GetExampleTableByU64StrRequest {
uint64 u64 = 1;
string str = 2;
}
// GetExampleTableByU64StrResponse is the TestSchemaQuery/GetExampleTableByU64StrResponse response type.
message GetExampleTableByU64StrResponse {
ExampleTable value = 1;
}
// ListExampleTableRequest is the TestSchemaQuery/ListExampleTableRequest request type.
message ListExampleTableRequest {
// IndexKey specifies the value of an index key to use in prefix and range queries.
message IndexKey {
// key specifies the index key value.
oneof key {
// u_32_i_64_str specifies the value of the U32I64Str index key to use in the query.
U32I64Str u_32_i_64_str = 1;
// u_64_str specifies the value of the U64Str index key to use in the query.
U64Str u_64_str = 2;
// str_u_32 specifies the value of the StrU32 index key to use in the query.
StrU32 str_u_32 = 3;
// bz_str specifies the value of the BzStr index key to use in the query.
BzStr bz_str = 4;
}
message U32I64Str {
// u32 is the value of the u32 field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional uint32 u32 = 1;
// i64 is the value of the i64 field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional int64 i64 = 2;
// str is the value of the str field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string str = 3;
}
message U64Str {
// u64 is the value of the u64 field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional uint64 u64 = 1;
// str is the value of the str field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string str = 2;
}
message StrU32 {
// str is the value of the str field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string str = 1;
// u32 is the value of the u32 field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional uint32 u32 = 2;
}
message BzStr {
// bz is the value of the bz field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional bytes bz = 1;
// str is the value of the str field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string str = 2;
}
}
// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
IndexKey prefix_query = 1;
// range_query specifies the index key from/to values to use for the range query.
RangeQuery range_query = 2;
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
// To query from the start of an index, specify an index key for that index with empty values.
IndexKey from = 1;
// to is the index key to use for the end of the range query.
// The index key type MUST be the same as the index key type used for from.
// To query from to the end of an index it can be omitted.
IndexKey to = 2;
}
}
// ListExampleTableResponse is the TestSchemaQuery/ListExampleTableResponse response type.
message ListExampleTableResponse {
// values are the results of the query.
repeated ExampleTable values = 1;
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetExampleAutoIncrementTableRequest is the TestSchemaQuery/GetExampleAutoIncrementTableRequest request type.
message GetExampleAutoIncrementTableRequest {
// id specifies the value of the id field in the primary key.
uint64 id = 1;
}
// GetExampleAutoIncrementTableResponse is the TestSchemaQuery/GetExampleAutoIncrementTableResponse response type.
message GetExampleAutoIncrementTableResponse {
// value is the response value.
ExampleAutoIncrementTable value = 1;
}
// GetExampleAutoIncrementTableByXRequest is the TestSchemaQuery/GetExampleAutoIncrementTableByXRequest request type.
message GetExampleAutoIncrementTableByXRequest {
string x = 1;
}
// GetExampleAutoIncrementTableByXResponse is the TestSchemaQuery/GetExampleAutoIncrementTableByXResponse response type.
message GetExampleAutoIncrementTableByXResponse {
ExampleAutoIncrementTable value = 1;
}
// ListExampleAutoIncrementTableRequest is the TestSchemaQuery/ListExampleAutoIncrementTableRequest request type.
message ListExampleAutoIncrementTableRequest {
// IndexKey specifies the value of an index key to use in prefix and range queries.
message IndexKey {
// key specifies the index key value.
oneof key {
// id specifies the value of the Id index key to use in the query.
Id id = 1;
// x specifies the value of the X index key to use in the query.
X x = 2;
}
message Id {
// id is the value of the id field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional uint64 id = 1;
}
message X {
// x is the value of the x field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string x = 1;
}
}
// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
IndexKey prefix_query = 1;
// range_query specifies the index key from/to values to use for the range query.
RangeQuery range_query = 2;
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
// To query from the start of an index, specify an index key for that index with empty values.
IndexKey from = 1;
// to is the index key to use for the end of the range query.
// The index key type MUST be the same as the index key type used for from.
// To query from to the end of an index it can be omitted.
IndexKey to = 2;
}
}
// ListExampleAutoIncrementTableResponse is the TestSchemaQuery/ListExampleAutoIncrementTableResponse response type.
message ListExampleAutoIncrementTableResponse {
// values are the results of the query.
repeated ExampleAutoIncrementTable values = 1;
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetExampleSingletonRequest is the TestSchemaQuery/GetExampleSingletonRequest request type.
message GetExampleSingletonRequest {
}
// GetExampleSingletonResponse is the TestSchemaQuery/GetExampleSingletonResponse request type.
message GetExampleSingletonResponse {
ExampleSingleton value = 1;
}
// GetExampleTimestampRequest is the TestSchemaQuery/GetExampleTimestampRequest request type.
message GetExampleTimestampRequest {
// id specifies the value of the id field in the primary key.
uint64 id = 1;
}
// GetExampleTimestampResponse is the TestSchemaQuery/GetExampleTimestampResponse response type.
message GetExampleTimestampResponse {
// value is the response value.
ExampleTimestamp value = 1;
}
// ListExampleTimestampRequest is the TestSchemaQuery/ListExampleTimestampRequest request type.
message ListExampleTimestampRequest {
// IndexKey specifies the value of an index key to use in prefix and range queries.
message IndexKey {
// key specifies the index key value.
oneof key {
// id specifies the value of the Id index key to use in the query.
Id id = 1;
// ts specifies the value of the Ts index key to use in the query.
Ts ts = 2;
}
message Id {
// id is the value of the id field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional uint64 id = 1;
}
message Ts {
// ts is the value of the ts field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional google.protobuf.Timestamp ts = 1;
}
}
// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
IndexKey prefix_query = 1;
// range_query specifies the index key from/to values to use for the range query.
RangeQuery range_query = 2;
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
// To query from the start of an index, specify an index key for that index with empty values.
IndexKey from = 1;
// to is the index key to use for the end of the range query.
// The index key type MUST be the same as the index key type used for from.
// To query from to the end of an index it can be omitted.
IndexKey to = 2;
}
}
// ListExampleTimestampResponse is the TestSchemaQuery/ListExampleTimestampResponse response type.
message ListExampleTimestampResponse {
// values are the results of the query.
repeated ExampleTimestamp values = 1;
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetSimpleExampleRequest is the TestSchemaQuery/GetSimpleExampleRequest request type.
message GetSimpleExampleRequest {
// name specifies the value of the name field in the primary key.
string name = 1;
}
// GetSimpleExampleResponse is the TestSchemaQuery/GetSimpleExampleResponse response type.
message GetSimpleExampleResponse {
// value is the response value.
SimpleExample value = 1;
}
// GetSimpleExampleByUniqueRequest is the TestSchemaQuery/GetSimpleExampleByUniqueRequest request type.
message GetSimpleExampleByUniqueRequest {
string unique = 1;
}
// GetSimpleExampleByUniqueResponse is the TestSchemaQuery/GetSimpleExampleByUniqueResponse response type.
message GetSimpleExampleByUniqueResponse {
SimpleExample value = 1;
}
// ListSimpleExampleRequest is the TestSchemaQuery/ListSimpleExampleRequest request type.
message ListSimpleExampleRequest {
// IndexKey specifies the value of an index key to use in prefix and range queries.
message IndexKey {
// key specifies the index key value.
oneof key {
// name specifies the value of the Name index key to use in the query.
Name name = 1;
// unique specifies the value of the Unique index key to use in the query.
Unique unique = 2;
}
message Name {
// name is the value of the name field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string name = 1;
}
message Unique {
// unique is the value of the unique field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional string unique = 1;
}
}
// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
IndexKey prefix_query = 1;
// range_query specifies the index key from/to values to use for the range query.
RangeQuery range_query = 2;
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
// To query from the start of an index, specify an index key for that index with empty values.
IndexKey from = 1;
// to is the index key to use for the end of the range query.
// The index key type MUST be the same as the index key type used for from.
// To query from to the end of an index it can be omitted.
IndexKey to = 2;
}
}
// ListSimpleExampleResponse is the TestSchemaQuery/ListSimpleExampleResponse response type.
message ListSimpleExampleResponse {
// values are the results of the query.
repeated SimpleExample values = 1;
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetExampleAutoIncFieldNameRequest is the TestSchemaQuery/GetExampleAutoIncFieldNameRequest request type.
message GetExampleAutoIncFieldNameRequest {
// foo specifies the value of the foo field in the primary key.
uint64 foo = 1;
}
// GetExampleAutoIncFieldNameResponse is the TestSchemaQuery/GetExampleAutoIncFieldNameResponse response type.
message GetExampleAutoIncFieldNameResponse {
// value is the response value.
ExampleAutoIncFieldName value = 1;
}
// ListExampleAutoIncFieldNameRequest is the TestSchemaQuery/ListExampleAutoIncFieldNameRequest request type.
message ListExampleAutoIncFieldNameRequest {
// IndexKey specifies the value of an index key to use in prefix and range queries.
message IndexKey {
// key specifies the index key value.
oneof key {
// foo specifies the value of the Foo index key to use in the query.
Foo foo = 1;
}
message Foo {
// foo is the value of the foo field in the index.
// It can be omitted to query for all valid values of that field in this segment of the index.
optional uint64 foo = 1;
}
}
// query specifies the type of query - either a prefix or range query.
oneof query {
// prefix_query specifies the index key value to use for the prefix query.
IndexKey prefix_query = 1;
// range_query specifies the index key from/to values to use for the range query.
RangeQuery range_query = 2;
}
// pagination specifies optional pagination parameters.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
// RangeQuery specifies the from/to index keys for a range query.
message RangeQuery {
// from is the index key to use for the start of the range query.
// To query from the start of an index, specify an index key for that index with empty values.
IndexKey from = 1;
// to is the index key to use for the end of the range query.
// The index key type MUST be the same as the index key type used for from.
// To query from to the end of an index it can be omitted.
IndexKey to = 2;
}
}
// ListExampleAutoIncFieldNameResponse is the TestSchemaQuery/ListExampleAutoIncFieldNameResponse response type.
message ListExampleAutoIncFieldNameResponse {
// values are the results of the query.
repeated ExampleAutoIncFieldName values = 1;
// pagination is the pagination response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

View File

@ -0,0 +1,601 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc (unknown)
// source: testpb/test_schema_query.proto
package testpb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// TestSchemaQueryClient is the client API for TestSchemaQuery service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type TestSchemaQueryClient interface {
// Get queries the ExampleTable table by its primary key.
GetExampleTable(ctx context.Context, in *GetExampleTableRequest, opts ...grpc.CallOption) (*GetExampleTableResponse, error)
// GetExampleTableByU64Str queries the ExampleTable table by its U64Str index
GetExampleTableByU64Str(ctx context.Context, in *GetExampleTableByU64StrRequest, opts ...grpc.CallOption) (*GetExampleTableByU64StrResponse, error)
// ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes.
ListExampleTable(ctx context.Context, in *ListExampleTableRequest, opts ...grpc.CallOption) (*ListExampleTableResponse, error)
// Get queries the ExampleAutoIncrementTable table by its primary key.
GetExampleAutoIncrementTable(ctx context.Context, in *GetExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableResponse, error)
// GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index
GetExampleAutoIncrementTableByX(ctx context.Context, in *GetExampleAutoIncrementTableByXRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableByXResponse, error)
// ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes.
ListExampleAutoIncrementTable(ctx context.Context, in *ListExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*ListExampleAutoIncrementTableResponse, error)
// GetExampleSingleton queries the ExampleSingleton singleton.
GetExampleSingleton(ctx context.Context, in *GetExampleSingletonRequest, opts ...grpc.CallOption) (*GetExampleSingletonResponse, error)
// Get queries the ExampleTimestamp table by its primary key.
GetExampleTimestamp(ctx context.Context, in *GetExampleTimestampRequest, opts ...grpc.CallOption) (*GetExampleTimestampResponse, error)
// ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes.
ListExampleTimestamp(ctx context.Context, in *ListExampleTimestampRequest, opts ...grpc.CallOption) (*ListExampleTimestampResponse, error)
// Get queries the SimpleExample table by its primary key.
GetSimpleExample(ctx context.Context, in *GetSimpleExampleRequest, opts ...grpc.CallOption) (*GetSimpleExampleResponse, error)
// GetSimpleExampleByUnique queries the SimpleExample table by its Unique index
GetSimpleExampleByUnique(ctx context.Context, in *GetSimpleExampleByUniqueRequest, opts ...grpc.CallOption) (*GetSimpleExampleByUniqueResponse, error)
// ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes.
ListSimpleExample(ctx context.Context, in *ListSimpleExampleRequest, opts ...grpc.CallOption) (*ListSimpleExampleResponse, error)
// Get queries the ExampleAutoIncFieldName table by its primary key.
GetExampleAutoIncFieldName(ctx context.Context, in *GetExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*GetExampleAutoIncFieldNameResponse, error)
// ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes.
ListExampleAutoIncFieldName(ctx context.Context, in *ListExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*ListExampleAutoIncFieldNameResponse, error)
}
type testSchemaQueryClient struct {
cc grpc.ClientConnInterface
}
func NewTestSchemaQueryClient(cc grpc.ClientConnInterface) TestSchemaQueryClient {
return &testSchemaQueryClient{cc}
}
func (c *testSchemaQueryClient) GetExampleTable(ctx context.Context, in *GetExampleTableRequest, opts ...grpc.CallOption) (*GetExampleTableResponse, error) {
out := new(GetExampleTableResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetExampleTable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetExampleTableByU64Str(ctx context.Context, in *GetExampleTableByU64StrRequest, opts ...grpc.CallOption) (*GetExampleTableByU64StrResponse, error) {
out := new(GetExampleTableByU64StrResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetExampleTableByU64Str", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) ListExampleTable(ctx context.Context, in *ListExampleTableRequest, opts ...grpc.CallOption) (*ListExampleTableResponse, error) {
out := new(ListExampleTableResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/ListExampleTable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetExampleAutoIncrementTable(ctx context.Context, in *GetExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableResponse, error) {
out := new(GetExampleAutoIncrementTableResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetExampleAutoIncrementTable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetExampleAutoIncrementTableByX(ctx context.Context, in *GetExampleAutoIncrementTableByXRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableByXResponse, error) {
out := new(GetExampleAutoIncrementTableByXResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetExampleAutoIncrementTableByX", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) ListExampleAutoIncrementTable(ctx context.Context, in *ListExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*ListExampleAutoIncrementTableResponse, error) {
out := new(ListExampleAutoIncrementTableResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/ListExampleAutoIncrementTable", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetExampleSingleton(ctx context.Context, in *GetExampleSingletonRequest, opts ...grpc.CallOption) (*GetExampleSingletonResponse, error) {
out := new(GetExampleSingletonResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetExampleSingleton", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetExampleTimestamp(ctx context.Context, in *GetExampleTimestampRequest, opts ...grpc.CallOption) (*GetExampleTimestampResponse, error) {
out := new(GetExampleTimestampResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetExampleTimestamp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) ListExampleTimestamp(ctx context.Context, in *ListExampleTimestampRequest, opts ...grpc.CallOption) (*ListExampleTimestampResponse, error) {
out := new(ListExampleTimestampResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/ListExampleTimestamp", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetSimpleExample(ctx context.Context, in *GetSimpleExampleRequest, opts ...grpc.CallOption) (*GetSimpleExampleResponse, error) {
out := new(GetSimpleExampleResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetSimpleExample", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetSimpleExampleByUnique(ctx context.Context, in *GetSimpleExampleByUniqueRequest, opts ...grpc.CallOption) (*GetSimpleExampleByUniqueResponse, error) {
out := new(GetSimpleExampleByUniqueResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetSimpleExampleByUnique", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) ListSimpleExample(ctx context.Context, in *ListSimpleExampleRequest, opts ...grpc.CallOption) (*ListSimpleExampleResponse, error) {
out := new(ListSimpleExampleResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/ListSimpleExample", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) GetExampleAutoIncFieldName(ctx context.Context, in *GetExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*GetExampleAutoIncFieldNameResponse, error) {
out := new(GetExampleAutoIncFieldNameResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/GetExampleAutoIncFieldName", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *testSchemaQueryClient) ListExampleAutoIncFieldName(ctx context.Context, in *ListExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*ListExampleAutoIncFieldNameResponse, error) {
out := new(ListExampleAutoIncFieldNameResponse)
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQuery/ListExampleAutoIncFieldName", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// TestSchemaQueryServer is the server API for TestSchemaQuery service.
// All implementations must embed UnimplementedTestSchemaQueryServer
// for forward compatibility
type TestSchemaQueryServer interface {
// Get queries the ExampleTable table by its primary key.
GetExampleTable(context.Context, *GetExampleTableRequest) (*GetExampleTableResponse, error)
// GetExampleTableByU64Str queries the ExampleTable table by its U64Str index
GetExampleTableByU64Str(context.Context, *GetExampleTableByU64StrRequest) (*GetExampleTableByU64StrResponse, error)
// ListExampleTable queries the ExampleTable table using prefix and range queries against defined indexes.
ListExampleTable(context.Context, *ListExampleTableRequest) (*ListExampleTableResponse, error)
// Get queries the ExampleAutoIncrementTable table by its primary key.
GetExampleAutoIncrementTable(context.Context, *GetExampleAutoIncrementTableRequest) (*GetExampleAutoIncrementTableResponse, error)
// GetExampleAutoIncrementTableByX queries the ExampleAutoIncrementTable table by its X index
GetExampleAutoIncrementTableByX(context.Context, *GetExampleAutoIncrementTableByXRequest) (*GetExampleAutoIncrementTableByXResponse, error)
// ListExampleAutoIncrementTable queries the ExampleAutoIncrementTable table using prefix and range queries against defined indexes.
ListExampleAutoIncrementTable(context.Context, *ListExampleAutoIncrementTableRequest) (*ListExampleAutoIncrementTableResponse, error)
// GetExampleSingleton queries the ExampleSingleton singleton.
GetExampleSingleton(context.Context, *GetExampleSingletonRequest) (*GetExampleSingletonResponse, error)
// Get queries the ExampleTimestamp table by its primary key.
GetExampleTimestamp(context.Context, *GetExampleTimestampRequest) (*GetExampleTimestampResponse, error)
// ListExampleTimestamp queries the ExampleTimestamp table using prefix and range queries against defined indexes.
ListExampleTimestamp(context.Context, *ListExampleTimestampRequest) (*ListExampleTimestampResponse, error)
// Get queries the SimpleExample table by its primary key.
GetSimpleExample(context.Context, *GetSimpleExampleRequest) (*GetSimpleExampleResponse, error)
// GetSimpleExampleByUnique queries the SimpleExample table by its Unique index
GetSimpleExampleByUnique(context.Context, *GetSimpleExampleByUniqueRequest) (*GetSimpleExampleByUniqueResponse, error)
// ListSimpleExample queries the SimpleExample table using prefix and range queries against defined indexes.
ListSimpleExample(context.Context, *ListSimpleExampleRequest) (*ListSimpleExampleResponse, error)
// Get queries the ExampleAutoIncFieldName table by its primary key.
GetExampleAutoIncFieldName(context.Context, *GetExampleAutoIncFieldNameRequest) (*GetExampleAutoIncFieldNameResponse, error)
// ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes.
ListExampleAutoIncFieldName(context.Context, *ListExampleAutoIncFieldNameRequest) (*ListExampleAutoIncFieldNameResponse, error)
mustEmbedUnimplementedTestSchemaQueryServer()
}
// UnimplementedTestSchemaQueryServer must be embedded to have forward compatible implementations.
type UnimplementedTestSchemaQueryServer struct {
}
func (UnimplementedTestSchemaQueryServer) GetExampleTable(context.Context, *GetExampleTableRequest) (*GetExampleTableResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetExampleTable not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetExampleTableByU64Str(context.Context, *GetExampleTableByU64StrRequest) (*GetExampleTableByU64StrResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetExampleTableByU64Str not implemented")
}
func (UnimplementedTestSchemaQueryServer) ListExampleTable(context.Context, *ListExampleTableRequest) (*ListExampleTableResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListExampleTable not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetExampleAutoIncrementTable(context.Context, *GetExampleAutoIncrementTableRequest) (*GetExampleAutoIncrementTableResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncrementTable not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetExampleAutoIncrementTableByX(context.Context, *GetExampleAutoIncrementTableByXRequest) (*GetExampleAutoIncrementTableByXResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncrementTableByX not implemented")
}
func (UnimplementedTestSchemaQueryServer) ListExampleAutoIncrementTable(context.Context, *ListExampleAutoIncrementTableRequest) (*ListExampleAutoIncrementTableResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListExampleAutoIncrementTable not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetExampleSingleton(context.Context, *GetExampleSingletonRequest) (*GetExampleSingletonResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetExampleSingleton not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetExampleTimestamp(context.Context, *GetExampleTimestampRequest) (*GetExampleTimestampResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetExampleTimestamp not implemented")
}
func (UnimplementedTestSchemaQueryServer) ListExampleTimestamp(context.Context, *ListExampleTimestampRequest) (*ListExampleTimestampResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListExampleTimestamp not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetSimpleExample(context.Context, *GetSimpleExampleRequest) (*GetSimpleExampleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSimpleExample not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetSimpleExampleByUnique(context.Context, *GetSimpleExampleByUniqueRequest) (*GetSimpleExampleByUniqueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetSimpleExampleByUnique not implemented")
}
func (UnimplementedTestSchemaQueryServer) ListSimpleExample(context.Context, *ListSimpleExampleRequest) (*ListSimpleExampleResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSimpleExample not implemented")
}
func (UnimplementedTestSchemaQueryServer) GetExampleAutoIncFieldName(context.Context, *GetExampleAutoIncFieldNameRequest) (*GetExampleAutoIncFieldNameResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetExampleAutoIncFieldName not implemented")
}
func (UnimplementedTestSchemaQueryServer) ListExampleAutoIncFieldName(context.Context, *ListExampleAutoIncFieldNameRequest) (*ListExampleAutoIncFieldNameResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListExampleAutoIncFieldName not implemented")
}
func (UnimplementedTestSchemaQueryServer) mustEmbedUnimplementedTestSchemaQueryServer() {}
// UnsafeTestSchemaQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TestSchemaQueryServer will
// result in compilation errors.
type UnsafeTestSchemaQueryServer interface {
mustEmbedUnimplementedTestSchemaQueryServer()
}
func RegisterTestSchemaQueryServer(s grpc.ServiceRegistrar, srv TestSchemaQueryServer) {
s.RegisterService(&TestSchemaQuery_ServiceDesc, srv)
}
func _TestSchemaQuery_GetExampleTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExampleTableRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetExampleTable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetExampleTable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetExampleTable(ctx, req.(*GetExampleTableRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetExampleTableByU64Str_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExampleTableByU64StrRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetExampleTableByU64Str(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetExampleTableByU64Str",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetExampleTableByU64Str(ctx, req.(*GetExampleTableByU64StrRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_ListExampleTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListExampleTableRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).ListExampleTable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/ListExampleTable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).ListExampleTable(ctx, req.(*ListExampleTableRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetExampleAutoIncrementTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExampleAutoIncrementTableRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetExampleAutoIncrementTable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetExampleAutoIncrementTable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetExampleAutoIncrementTable(ctx, req.(*GetExampleAutoIncrementTableRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetExampleAutoIncrementTableByX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExampleAutoIncrementTableByXRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetExampleAutoIncrementTableByX(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetExampleAutoIncrementTableByX",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetExampleAutoIncrementTableByX(ctx, req.(*GetExampleAutoIncrementTableByXRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_ListExampleAutoIncrementTable_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListExampleAutoIncrementTableRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).ListExampleAutoIncrementTable(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/ListExampleAutoIncrementTable",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).ListExampleAutoIncrementTable(ctx, req.(*ListExampleAutoIncrementTableRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetExampleSingleton_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExampleSingletonRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetExampleSingleton(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetExampleSingleton",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetExampleSingleton(ctx, req.(*GetExampleSingletonRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetExampleTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExampleTimestampRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetExampleTimestamp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetExampleTimestamp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetExampleTimestamp(ctx, req.(*GetExampleTimestampRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_ListExampleTimestamp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListExampleTimestampRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).ListExampleTimestamp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/ListExampleTimestamp",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).ListExampleTimestamp(ctx, req.(*ListExampleTimestampRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetSimpleExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSimpleExampleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetSimpleExample(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetSimpleExample",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetSimpleExample(ctx, req.(*GetSimpleExampleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetSimpleExampleByUnique_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetSimpleExampleByUniqueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetSimpleExampleByUnique(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetSimpleExampleByUnique",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetSimpleExampleByUnique(ctx, req.(*GetSimpleExampleByUniqueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_ListSimpleExample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListSimpleExampleRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).ListSimpleExample(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/ListSimpleExample",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).ListSimpleExample(ctx, req.(*ListSimpleExampleRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_GetExampleAutoIncFieldName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetExampleAutoIncFieldNameRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).GetExampleAutoIncFieldName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/GetExampleAutoIncFieldName",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).GetExampleAutoIncFieldName(ctx, req.(*GetExampleAutoIncFieldNameRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TestSchemaQuery_ListExampleAutoIncFieldName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListExampleAutoIncFieldNameRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TestSchemaQueryServer).ListExampleAutoIncFieldName(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/testpb.TestSchemaQuery/ListExampleAutoIncFieldName",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TestSchemaQueryServer).ListExampleAutoIncFieldName(ctx, req.(*ListExampleAutoIncFieldNameRequest))
}
return interceptor(ctx, in, info, handler)
}
// TestSchemaQuery_ServiceDesc is the grpc.ServiceDesc for TestSchemaQuery service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TestSchemaQuery_ServiceDesc = grpc.ServiceDesc{
ServiceName: "testpb.TestSchemaQuery",
HandlerType: (*TestSchemaQueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetExampleTable",
Handler: _TestSchemaQuery_GetExampleTable_Handler,
},
{
MethodName: "GetExampleTableByU64Str",
Handler: _TestSchemaQuery_GetExampleTableByU64Str_Handler,
},
{
MethodName: "ListExampleTable",
Handler: _TestSchemaQuery_ListExampleTable_Handler,
},
{
MethodName: "GetExampleAutoIncrementTable",
Handler: _TestSchemaQuery_GetExampleAutoIncrementTable_Handler,
},
{
MethodName: "GetExampleAutoIncrementTableByX",
Handler: _TestSchemaQuery_GetExampleAutoIncrementTableByX_Handler,
},
{
MethodName: "ListExampleAutoIncrementTable",
Handler: _TestSchemaQuery_ListExampleAutoIncrementTable_Handler,
},
{
MethodName: "GetExampleSingleton",
Handler: _TestSchemaQuery_GetExampleSingleton_Handler,
},
{
MethodName: "GetExampleTimestamp",
Handler: _TestSchemaQuery_GetExampleTimestamp_Handler,
},
{
MethodName: "ListExampleTimestamp",
Handler: _TestSchemaQuery_ListExampleTimestamp_Handler,
},
{
MethodName: "GetSimpleExample",
Handler: _TestSchemaQuery_GetSimpleExample_Handler,
},
{
MethodName: "GetSimpleExampleByUnique",
Handler: _TestSchemaQuery_GetSimpleExampleByUnique_Handler,
},
{
MethodName: "ListSimpleExample",
Handler: _TestSchemaQuery_ListSimpleExample_Handler,
},
{
MethodName: "GetExampleAutoIncFieldName",
Handler: _TestSchemaQuery_GetExampleAutoIncFieldName_Handler,
},
{
MethodName: "ListExampleAutoIncFieldName",
Handler: _TestSchemaQuery_ListExampleAutoIncFieldName_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "testpb/test_schema_query.proto",
}