chore(orm)!: rename orm package to use a vanity url (#15870)
This commit is contained in:
+2
-1
@@ -42,7 +42,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
### API Breaking Changes
|
||||
|
||||
* [#14822](https://github.com/cosmos/cosmos-sdk/pull/14822) Migrate to cosmossdk.io/core genesis API
|
||||
* [#15870](https://github.com/cosmos/cosmos-sdk/pull/15870) Rename the orm package to `cosmossdk.io/orm`.
|
||||
* [#14822](https://github.com/cosmos/cosmos-sdk/pull/14822) Migrate to cosmossdk.io/core genesis API.
|
||||
|
||||
### State-machine Breaking Changes
|
||||
|
||||
|
||||
+20
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
The Cosmos SDK ORM is a state management library that provides a rich, but opinionated set of tools for managing a
|
||||
module's state. It provides support for:
|
||||
|
||||
* type safe management of state
|
||||
* multipart keys
|
||||
* secondary indexes
|
||||
@@ -56,8 +57,10 @@ of storage and not in the value leading to both a flexible data model and effici
|
||||
## Defining Tables
|
||||
|
||||
To define a table:
|
||||
|
||||
1) create a .proto file to describe the module's state (naming it `state.proto` is recommended for consistency),
|
||||
and import "cosmos/orm/v1/orm.proto", ex:
|
||||
|
||||
```protobuf
|
||||
syntax = "proto3";
|
||||
package bank_example;
|
||||
@@ -66,6 +69,7 @@ import "cosmos/orm/v1/orm.proto";
|
||||
```
|
||||
|
||||
2) define a `message` for the table, ex:
|
||||
|
||||
```protobuf
|
||||
message Balance {
|
||||
bytes account = 1;
|
||||
@@ -75,6 +79,7 @@ message Balance {
|
||||
```
|
||||
|
||||
3) add the `cosmos.orm.v1.table` option to the table and give the table an `id` unique within this .proto file:
|
||||
|
||||
```protobuf
|
||||
message Balance {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
@@ -89,6 +94,7 @@ message Balance {
|
||||
|
||||
4) define the primary key field or fields, as a comma-separated list of the fields from the message which should make
|
||||
up the primary key:
|
||||
|
||||
```protobuf
|
||||
message Balance {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
@@ -104,6 +110,7 @@ message Balance {
|
||||
|
||||
5) add any desired secondary indexes by specifying an `id` unique within the table and a comma-separate list of the
|
||||
index fields:
|
||||
|
||||
```protobuf
|
||||
message Balance {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
@@ -123,6 +130,7 @@ message Balance {
|
||||
A common pattern in SDK modules and in database design is to define tables with a single integer `id` field with an
|
||||
automatically generated primary key. In the ORM we can do this by setting the `auto_increment` option to `true` on the
|
||||
primary key, ex:
|
||||
|
||||
```protobuf
|
||||
message Account {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
@@ -138,6 +146,7 @@ message Account {
|
||||
### Unique Indexes
|
||||
|
||||
A unique index can be added by setting the `unique` option to `true` on an index, ex:
|
||||
|
||||
```protobuf
|
||||
message Account {
|
||||
option (cosmos.orm.v1.table) = {
|
||||
@@ -156,6 +165,7 @@ message Account {
|
||||
The ORM also supports a special type of table with only one row called a `singleton`. This can be used for storing
|
||||
module parameters. Singletons only need to define a unique `id` and that cannot conflict with the id of other
|
||||
tables or singletons in the same .proto file. Ex:
|
||||
|
||||
```protobuf
|
||||
message Params {
|
||||
option (cosmos.orm.v1.singleton) = {
|
||||
@@ -173,13 +183,15 @@ NOTE: the ORM will only work with protobuf code that implements the [google.gola
|
||||
API. That means it will not work with code generated using gogo-proto.
|
||||
|
||||
To install the ORM's code generator, run:
|
||||
|
||||
```shell
|
||||
go install github.com/cosmos/cosmos-sdk/orm/cmd/protoc-gen-go-cosmos-orm@latest
|
||||
go install cosmossdk.io/orm/cmd/protoc-gen-go-cosmos-orm@latest
|
||||
```
|
||||
|
||||
The recommended way to run the code generator is to use [buf build](https://docs.buf.build/build/usage).
|
||||
This is an example `buf.gen.yaml` that runs `protoc-gen-go`, `protoc-gen-go-grpc` and `protoc-gen-go-cosmos-orm`
|
||||
using buf managed mode:
|
||||
|
||||
```yaml
|
||||
version: v1
|
||||
managed:
|
||||
@@ -206,6 +218,7 @@ plugins:
|
||||
|
||||
To use the ORM in a module, first create a `ModuleSchemaDescriptor`. This tells the ORM which .proto files have defined
|
||||
an ORM schema and assigns them all a unique non-zero id. Ex:
|
||||
|
||||
```go
|
||||
var MyModuleSchema = &ormv1alpha1.ModuleSchemaDescriptor{
|
||||
SchemaFile: []*ormv1alpha1.ModuleSchemaDescriptor_FileEntry{
|
||||
@@ -220,6 +233,7 @@ var MyModuleSchema = &ormv1alpha1.ModuleSchemaDescriptor{
|
||||
In the ORM generated code for a file named `state.proto`, there should be an interface `StateStore` that got generated
|
||||
with a constructor `NewStateStore` that takes a parameter of type `ormdb.ModuleDB`. Add a reference to `StateStore`
|
||||
to your module's keeper struct. Ex:
|
||||
|
||||
```go
|
||||
type Keeper struct {
|
||||
db StateStore
|
||||
@@ -228,6 +242,7 @@ type Keeper struct {
|
||||
|
||||
Then instantiate the `StateStore` instance via an `ormdb.ModuleDB` that is instantiated from the `SchemaDescriptor`
|
||||
above and one or more store services from `cosmossdk.io/core/store`. Ex:
|
||||
|
||||
```go
|
||||
func NewKeeper(storeService store.KVStoreService) (*Keeper, error) {
|
||||
modDb, err := ormdb.NewModuleDB(MyModuleSchema, ormdb.ModuleDBOptions{KVStoreService: storeService})
|
||||
@@ -247,6 +262,7 @@ func NewKeeper(storeService store.KVStoreService) (*Keeper, error) {
|
||||
The generated code for the ORM contains methods for inserting, updating, deleting and querying table entries.
|
||||
For each table in a .proto file, there is a type-safe table interface implemented in generated code. For instance,
|
||||
for a table named `Balance` there should be a `BalanceTable` interface that looks like this:
|
||||
|
||||
```go
|
||||
type BalanceTable interface {
|
||||
Insert(ctx context.Context, balance *Balance) error
|
||||
@@ -268,6 +284,7 @@ type BalanceTable interface {
|
||||
This `BalanceTable` should be accessible from the `StateStore` interface (assuming our file is named `state.proto`)
|
||||
via a `BalanceTable()` accessor method. If all the above example tables/singletons were in the same `state.proto`,
|
||||
then `StateStore` would get generated like this:
|
||||
|
||||
```go
|
||||
type BankStore interface {
|
||||
BalanceTable() BalanceTable
|
||||
@@ -279,6 +296,7 @@ type BankStore interface {
|
||||
```
|
||||
|
||||
So to work with the `BalanceTable` in a keeper method we could use code like this:
|
||||
|
||||
```go
|
||||
func (k keeper) AddBalance(ctx context.Context, acct []byte, denom string, amount uint64) error {
|
||||
balance, err := k.db.BalanceTable().Get(ctx, acct, denom)
|
||||
@@ -305,6 +323,7 @@ let's represent index keys for the different indexes (primary and secondary) on
|
||||
in the `Balance` table gets a struct `BalanceAccountDenomIndexKey` and the first index gets an index key `BalanceDenomIndexKey`.
|
||||
If we wanted to list all the denoms and amounts that an account holds, we would use `BalanceAccountDenomIndexKey`
|
||||
with a `List` query just on the account prefix. Ex:
|
||||
|
||||
```go
|
||||
it, err := keeper.db.BalanceTable().List(ctx, BalanceAccountDenomIndexKey{}.WithAccount(acct))
|
||||
```
|
||||
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"google.golang.org/protobuf/compiler/protogen"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/codegen"
|
||||
"cosmossdk.io/orm/internal/codegen"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -3,7 +3,7 @@ package main
|
||||
import (
|
||||
"google.golang.org/protobuf/compiler/protogen"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/codegen"
|
||||
"cosmossdk.io/orm/internal/codegen"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -3,12 +3,11 @@ package ormfield
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/types/known/durationpb"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/types/known/durationpb"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
|
||||
// Codec defines an interface for decoding and encoding values in ORM index keys.
|
||||
|
||||
@@ -5,15 +5,13 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormfield"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"gotest.tools/v3/assert"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testutil"
|
||||
"cosmossdk.io/orm/encoding/ormfield"
|
||||
"cosmossdk.io/orm/internal/testutil"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
func TestCodec(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"google.golang.org/protobuf/types/known/durationpb"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormfield"
|
||||
"cosmossdk.io/orm/encoding/ormfield"
|
||||
)
|
||||
|
||||
func TestDuration(t *testing.T) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormfield"
|
||||
"cosmossdk.io/orm/encoding/ormfield"
|
||||
)
|
||||
|
||||
func TestTimestamp(t *testing.T) {
|
||||
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/stablejson"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"cosmossdk.io/orm/internal/stablejson"
|
||||
)
|
||||
|
||||
// Entry defines a logical representation of a kv-store entry for ORM instances.
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
)
|
||||
|
||||
var aFullName = (&testpb.ExampleTable{}).ProtoReflect().Descriptor().FullName()
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// IndexKeyCodec is the codec for (non-unique) index keys.
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"gotest.tools/v3/assert"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/internal/testutil"
|
||||
)
|
||||
|
||||
func TestIndexKeyCodec(t *testing.T) {
|
||||
|
||||
@@ -4,12 +4,11 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormfield"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormfield"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type KeyCodec struct {
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
"gotest.tools/v3/assert"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testutil"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/internal/testutil"
|
||||
)
|
||||
|
||||
func TestKeyCodec(t *testing.T) {
|
||||
|
||||
@@ -4,11 +4,10 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// PrimaryKeyCodec is the codec for primary keys.
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"gotest.tools/v3/assert"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/internal/testutil"
|
||||
)
|
||||
|
||||
func TestPrimaryKeyCodec(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// SeqCodec is the codec for auto-incrementing uint64 primary key sequences.
|
||||
|
||||
@@ -4,12 +4,11 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
)
|
||||
|
||||
func TestSeqCodec(t *testing.T) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import (
|
||||
"bytes"
|
||||
"io"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// UniqueKeyCodec is the codec for unique indexes.
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
"gotest.tools/v3/assert"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/internal/testutil"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
func TestUniqueKeyCodec(t *testing.T) {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
module github.com/cosmos/cosmos-sdk/orm
|
||||
module cosmossdk.io/orm
|
||||
|
||||
go 1.20
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ version: v1
|
||||
managed:
|
||||
enabled: true
|
||||
go_package_prefix:
|
||||
default: github.com/cosmos/cosmos-sdk/orm/internal
|
||||
default: cosmossdk.io/orm/internal
|
||||
override:
|
||||
buf.build/cosmos/cosmos-sdk: cosmossdk.io/api
|
||||
plugins:
|
||||
|
||||
@@ -2,7 +2,7 @@ version: v1
|
||||
managed:
|
||||
enabled: true
|
||||
go_package_prefix:
|
||||
default: github.com/cosmos/cosmos-sdk/orm/internal
|
||||
default: cosmossdk.io/orm/internal
|
||||
override:
|
||||
buf.build/cosmos/cosmos-sdk: cosmossdk.io/api
|
||||
plugins:
|
||||
|
||||
@@ -14,9 +14,9 @@ import (
|
||||
|
||||
const (
|
||||
contextPkg = protogen.GoImportPath("context")
|
||||
ormListPkg = protogen.GoImportPath("github.com/cosmos/cosmos-sdk/orm/model/ormlist")
|
||||
ormErrPkg = protogen.GoImportPath("github.com/cosmos/cosmos-sdk/orm/types/ormerrors")
|
||||
ormTablePkg = protogen.GoImportPath("github.com/cosmos/cosmos-sdk/orm/model/ormtable")
|
||||
ormListPkg = protogen.GoImportPath("cosmossdk.io/orm/model/ormlist")
|
||||
ormErrPkg = protogen.GoImportPath("cosmossdk.io/orm/types/ormerrors")
|
||||
ormTablePkg = protogen.GoImportPath("cosmossdk.io/orm/model/ormtable")
|
||||
)
|
||||
|
||||
func ORMPluginRunner(p *protogen.Plugin) error {
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
ormv1 "cosmossdk.io/api/cosmos/orm/v1"
|
||||
"github.com/iancoleman/strcase"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
@@ -13,7 +12,9 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
|
||||
ormv1 "cosmossdk.io/api/cosmos/orm/v1"
|
||||
|
||||
"cosmossdk.io/orm/internal/fieldnames"
|
||||
)
|
||||
|
||||
type queryProtoGen struct {
|
||||
@@ -231,7 +232,7 @@ func (g queryProtoGen) genTableRPCMethods(msg *protogen.Message, desc *ormv1.Tab
|
||||
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.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("")
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
ormv1 "cosmossdk.io/api/cosmos/orm/v1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
type singletonGen struct {
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
|
||||
ormv1 "cosmossdk.io/api/cosmos/orm/v1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/internal/fieldnames"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
type tableGen struct {
|
||||
|
||||
@@ -4,14 +4,14 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"google.golang.org/protobuf/types/known/anypb"
|
||||
|
||||
bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1"
|
||||
basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1"
|
||||
txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1"
|
||||
"github.com/cosmos/cosmos-proto/anyutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/stablejson"
|
||||
|
||||
"cosmossdk.io/orm/internal/stablejson"
|
||||
)
|
||||
|
||||
func TestStableJSON(t *testing.T) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
)
|
||||
|
||||
func AssertBackendsEqual(t assert.TestingT, b1, b2 ormtable.Backend) {
|
||||
|
||||
@@ -6,10 +6,10 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/stablejson"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/stablejson"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
)
|
||||
|
||||
// Debugger is an interface that handles debug info from the debug store wrapper.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
func NewGoLevelDBBackend(t testing.TB) ormtable.Backend {
|
||||
|
||||
@@ -3,7 +3,7 @@ package testkv
|
||||
import (
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
// NewSplitMemBackend returns a Backend instance
|
||||
|
||||
@@ -4,9 +4,9 @@ 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"
|
||||
ormlist "cosmossdk.io/orm/model/ormlist"
|
||||
ormtable "cosmossdk.io/orm/model/ormtable"
|
||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type BalanceTable interface {
|
||||
|
||||
@@ -207,16 +207,15 @@ var file_testpb_bank_proto_rawDesc = []byte{
|
||||
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,
|
||||
0x8e, 0x03, 0x0b, 0x0a, 0x07, 0x0a, 0x05, 0x64, 0x65, 0x6e, 0x6f, 0x6d, 0x18, 0x02, 0x42, 0x71,
|
||||
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, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
|
||||
0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 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 (
|
||||
|
||||
@@ -1104,16 +1104,15 @@ var file_testpb_bank_query_proto_rawDesc = []byte{
|
||||
0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70,
|
||||
0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74,
|
||||
0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x0e, 0x42, 0x61, 0x6e, 0x6b, 0x51, 0x75, 0x65, 0x72,
|
||||
0x79, 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,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x76, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74,
|
||||
0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x0e, 0x42, 0x61, 0x6e, 0x6b, 0x51, 0x75, 0x65, 0x72, 0x79,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73,
|
||||
0x64, 0x6b, 0x2e, 0x69, 0x6f, 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 (
|
||||
|
||||
@@ -42,7 +42,7 @@ message ListBalanceRequest {
|
||||
// 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.
|
||||
@@ -51,14 +51,14 @@ message ListBalanceRequest {
|
||||
// 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.
|
||||
@@ -68,7 +68,7 @@ message ListBalanceRequest {
|
||||
}
|
||||
// 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.
|
||||
@@ -110,14 +110,14 @@ message ListSupplyRequest {
|
||||
// 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.
|
||||
@@ -127,7 +127,7 @@ message ListSupplyRequest {
|
||||
}
|
||||
// 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.
|
||||
@@ -147,3 +147,4 @@ message ListSupplyResponse {
|
||||
// pagination is the pagination response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT.
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: testpb/bank_query.proto
|
||||
|
||||
@@ -18,6 +20,13 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
BankQueryService_GetBalance_FullMethodName = "/testpb.BankQueryService/GetBalance"
|
||||
BankQueryService_ListBalance_FullMethodName = "/testpb.BankQueryService/ListBalance"
|
||||
BankQueryService_GetSupply_FullMethodName = "/testpb.BankQueryService/GetSupply"
|
||||
BankQueryService_ListSupply_FullMethodName = "/testpb.BankQueryService/ListSupply"
|
||||
)
|
||||
|
||||
// BankQueryServiceClient is the client API for BankQueryService 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.
|
||||
@@ -42,7 +51,7 @@ func NewBankQueryServiceClient(cc grpc.ClientConnInterface) BankQueryServiceClie
|
||||
|
||||
func (c *bankQueryServiceClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) {
|
||||
out := new(GetBalanceResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.BankQueryService/GetBalance", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, BankQueryService_GetBalance_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -51,7 +60,7 @@ func (c *bankQueryServiceClient) GetBalance(ctx context.Context, in *GetBalanceR
|
||||
|
||||
func (c *bankQueryServiceClient) ListBalance(ctx context.Context, in *ListBalanceRequest, opts ...grpc.CallOption) (*ListBalanceResponse, error) {
|
||||
out := new(ListBalanceResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.BankQueryService/ListBalance", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, BankQueryService_ListBalance_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -60,7 +69,7 @@ func (c *bankQueryServiceClient) ListBalance(ctx context.Context, in *ListBalanc
|
||||
|
||||
func (c *bankQueryServiceClient) GetSupply(ctx context.Context, in *GetSupplyRequest, opts ...grpc.CallOption) (*GetSupplyResponse, error) {
|
||||
out := new(GetSupplyResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.BankQueryService/GetSupply", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, BankQueryService_GetSupply_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -69,7 +78,7 @@ func (c *bankQueryServiceClient) GetSupply(ctx context.Context, in *GetSupplyReq
|
||||
|
||||
func (c *bankQueryServiceClient) ListSupply(ctx context.Context, in *ListSupplyRequest, opts ...grpc.CallOption) (*ListSupplyResponse, error) {
|
||||
out := new(ListSupplyResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.BankQueryService/ListSupply", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, BankQueryService_ListSupply_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -130,7 +139,7 @@ func _BankQueryService_GetBalance_Handler(srv interface{}, ctx context.Context,
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.BankQueryService/GetBalance",
|
||||
FullMethod: BankQueryService_GetBalance_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BankQueryServiceServer).GetBalance(ctx, req.(*GetBalanceRequest))
|
||||
@@ -148,7 +157,7 @@ func _BankQueryService_ListBalance_Handler(srv interface{}, ctx context.Context,
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.BankQueryService/ListBalance",
|
||||
FullMethod: BankQueryService_ListBalance_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BankQueryServiceServer).ListBalance(ctx, req.(*ListBalanceRequest))
|
||||
@@ -166,7 +175,7 @@ func _BankQueryService_GetSupply_Handler(srv interface{}, ctx context.Context, d
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.BankQueryService/GetSupply",
|
||||
FullMethod: BankQueryService_GetSupply_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BankQueryServiceServer).GetSupply(ctx, req.(*GetSupplyRequest))
|
||||
@@ -184,7 +193,7 @@ func _BankQueryService_ListSupply_Handler(srv interface{}, ctx context.Context,
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.BankQueryService/ListSupply",
|
||||
FullMethod: BankQueryService_ListSupply_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BankQueryServiceServer).ListSupply(ctx, req.(*ListSupplyRequest))
|
||||
|
||||
@@ -4,9 +4,9 @@ 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"
|
||||
ormlist "cosmossdk.io/orm/model/ormlist"
|
||||
ormtable "cosmossdk.io/orm/model/ormtable"
|
||||
ormerrors "cosmossdk.io/orm/types/ormerrors"
|
||||
durationpb "google.golang.org/protobuf/types/known/durationpb"
|
||||
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
|
||||
)
|
||||
@@ -544,6 +544,7 @@ func NewExampleTimestampTable(db ormtable.Schema) (ExampleTimestampTable, error)
|
||||
type ExampleDurationTable interface {
|
||||
Insert(ctx context.Context, exampleDuration *ExampleDuration) error
|
||||
InsertReturningId(ctx context.Context, exampleDuration *ExampleDuration) (uint64, error)
|
||||
LastInsertedSequence(ctx context.Context) (uint64, error)
|
||||
Update(ctx context.Context, exampleDuration *ExampleDuration) error
|
||||
Save(ctx context.Context, exampleDuration *ExampleDuration) error
|
||||
Delete(ctx context.Context, exampleDuration *ExampleDuration) error
|
||||
@@ -627,6 +628,10 @@ func (this exampleDurationTable) InsertReturningId(ctx context.Context, exampleD
|
||||
return this.table.InsertReturningPKey(ctx, exampleDuration)
|
||||
}
|
||||
|
||||
func (this exampleDurationTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
|
||||
return this.table.LastInsertedSequence(ctx)
|
||||
}
|
||||
|
||||
func (this exampleDurationTable) Has(ctx context.Context, id uint64) (found bool, err error) {
|
||||
return this.table.PrimaryKey().Has(ctx, id)
|
||||
}
|
||||
|
||||
@@ -817,16 +817,15 @@ var file_testpb_test_schema_proto_rawDesc = []byte{
|
||||
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,
|
||||
0xff, 0xff, 0x01, 0x42, 0x77, 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, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e,
|
||||
0x69, 0x6f, 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 (
|
||||
|
||||
@@ -1192,6 +1192,7 @@ type ListExampleDurationRequest struct {
|
||||
// query specifies the type of query - either a prefix or range query.
|
||||
//
|
||||
// Types that are assignable to Query:
|
||||
//
|
||||
// *ListExampleDurationRequest_PrefixQuery
|
||||
// *ListExampleDurationRequest_RangeQuery_
|
||||
Query isListExampleDurationRequest_Query `protobuf_oneof:"query"`
|
||||
@@ -2857,6 +2858,7 @@ type ListExampleDurationRequest_IndexKey struct {
|
||||
// key specifies the index key value.
|
||||
//
|
||||
// Types that are assignable to Key:
|
||||
//
|
||||
// *ListExampleDurationRequest_IndexKey_Id_
|
||||
// *ListExampleDurationRequest_IndexKey_Dur_
|
||||
Key isListExampleDurationRequest_IndexKey_Key `protobuf_oneof:"key"`
|
||||
@@ -4058,16 +4060,15 @@ var file_testpb_test_schema_query_proto_rawDesc = []byte{
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4c, 0x69,
|
||||
0x73, 0x74, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x49, 0x6e, 0x63,
|
||||
0x46, 0x69, 0x65, 0x6c, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x42, 0x8c, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74,
|
||||
0x70, 0x62, 0x42, 0x14, 0x54, 0x65, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x51, 0x75,
|
||||
0x65, 0x72, 0x79, 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,
|
||||
0x65, 0x22, 0x00, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70,
|
||||
0x62, 0x42, 0x14, 0x54, 0x65, 0x73, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x51, 0x75, 0x65,
|
||||
0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f,
|
||||
0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 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 (
|
||||
|
||||
@@ -16,15 +16,11 @@ service TestSchemaQueryService {
|
||||
// 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) {
|
||||
}
|
||||
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) {}
|
||||
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.
|
||||
@@ -43,8 +39,7 @@ service TestSchemaQueryService {
|
||||
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.
|
||||
// ListExampleAutoIncFieldName queries the ExampleAutoIncFieldName table using prefix and range queries against defined indexes.
|
||||
rpc ListExampleAutoIncFieldName(ListExampleAutoIncFieldNameRequest) returns (ListExampleAutoIncFieldNameResponse) {}
|
||||
}
|
||||
|
||||
@@ -90,7 +85,7 @@ message ListExampleTableRequest {
|
||||
// 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.
|
||||
@@ -102,7 +97,7 @@ message ListExampleTableRequest {
|
||||
// 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.
|
||||
@@ -111,7 +106,7 @@ message ListExampleTableRequest {
|
||||
// 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.
|
||||
@@ -120,7 +115,7 @@ message ListExampleTableRequest {
|
||||
// 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.
|
||||
@@ -130,7 +125,7 @@ message ListExampleTableRequest {
|
||||
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.
|
||||
@@ -140,7 +135,7 @@ message ListExampleTableRequest {
|
||||
}
|
||||
// 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.
|
||||
@@ -194,20 +189,20 @@ message ListExampleAutoIncrementTableRequest {
|
||||
// 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.
|
||||
@@ -217,7 +212,7 @@ message ListExampleAutoIncrementTableRequest {
|
||||
}
|
||||
// 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.
|
||||
@@ -239,7 +234,8 @@ message ListExampleAutoIncrementTableResponse {
|
||||
}
|
||||
|
||||
// GetExampleSingletonRequest is the TestSchemaQuery/GetExampleSingletonRequest request type.
|
||||
message GetExampleSingletonRequest {}
|
||||
message GetExampleSingletonRequest {
|
||||
}
|
||||
|
||||
// GetExampleSingletonResponse is the TestSchemaQuery/GetExampleSingletonResponse request type.
|
||||
message GetExampleSingletonResponse {
|
||||
@@ -269,20 +265,20 @@ message ListExampleTimestampRequest {
|
||||
// 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.
|
||||
@@ -292,7 +288,7 @@ message ListExampleTimestampRequest {
|
||||
}
|
||||
// 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.
|
||||
@@ -413,20 +409,20 @@ message ListSimpleExampleRequest {
|
||||
// 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.
|
||||
@@ -436,7 +432,7 @@ message ListSimpleExampleRequest {
|
||||
}
|
||||
// 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.
|
||||
@@ -478,14 +474,14 @@ message ListExampleAutoIncFieldNameRequest {
|
||||
// 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.
|
||||
@@ -495,7 +491,7 @@ message ListExampleAutoIncFieldNameRequest {
|
||||
}
|
||||
// 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.
|
||||
@@ -515,3 +511,4 @@ message ListExampleAutoIncFieldNameResponse {
|
||||
// pagination is the pagination response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// Code generated by protoc-gen-go-cosmos-orm-proto. DO NOT EDIT.
|
||||
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc-gen-go-grpc v1.3.0
|
||||
// - protoc (unknown)
|
||||
// source: testpb/test_schema_query.proto
|
||||
|
||||
@@ -18,6 +20,25 @@ import (
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
TestSchemaQueryService_GetExampleTable_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTable"
|
||||
TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTableByU64Str"
|
||||
TestSchemaQueryService_ListExampleTable_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleTable"
|
||||
TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTable"
|
||||
TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTableByX"
|
||||
TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleAutoIncrementTable"
|
||||
TestSchemaQueryService_GetExampleSingleton_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleSingleton"
|
||||
TestSchemaQueryService_GetExampleTimestamp_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleTimestamp"
|
||||
TestSchemaQueryService_ListExampleTimestamp_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleTimestamp"
|
||||
TestSchemaQueryService_GetExampleDuration_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleDuration"
|
||||
TestSchemaQueryService_ListExampleDuration_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleDuration"
|
||||
TestSchemaQueryService_GetSimpleExample_FullMethodName = "/testpb.TestSchemaQueryService/GetSimpleExample"
|
||||
TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName = "/testpb.TestSchemaQueryService/GetSimpleExampleByUnique"
|
||||
TestSchemaQueryService_ListSimpleExample_FullMethodName = "/testpb.TestSchemaQueryService/ListSimpleExample"
|
||||
TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName = "/testpb.TestSchemaQueryService/GetExampleAutoIncFieldName"
|
||||
TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName = "/testpb.TestSchemaQueryService/ListExampleAutoIncFieldName"
|
||||
)
|
||||
|
||||
// TestSchemaQueryServiceClient is the client API for TestSchemaQueryService 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.
|
||||
@@ -66,7 +87,7 @@ func NewTestSchemaQueryServiceClient(cc grpc.ClientConnInterface) TestSchemaQuer
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleTable(ctx context.Context, in *GetExampleTableRequest, opts ...grpc.CallOption) (*GetExampleTableResponse, error) {
|
||||
out := new(GetExampleTableResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleTable", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTable_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -75,7 +96,7 @@ func (c *testSchemaQueryServiceClient) GetExampleTable(ctx context.Context, in *
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleTableByU64Str(ctx context.Context, in *GetExampleTableByU64StrRequest, opts ...grpc.CallOption) (*GetExampleTableByU64StrResponse, error) {
|
||||
out := new(GetExampleTableByU64StrResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleTableByU64Str", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -84,7 +105,7 @@ func (c *testSchemaQueryServiceClient) GetExampleTableByU64Str(ctx context.Conte
|
||||
|
||||
func (c *testSchemaQueryServiceClient) ListExampleTable(ctx context.Context, in *ListExampleTableRequest, opts ...grpc.CallOption) (*ListExampleTableResponse, error) {
|
||||
out := new(ListExampleTableResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/ListExampleTable", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleTable_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -93,7 +114,7 @@ func (c *testSchemaQueryServiceClient) ListExampleTable(ctx context.Context, in
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTable(ctx context.Context, in *GetExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableResponse, error) {
|
||||
out := new(GetExampleAutoIncrementTableResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTable", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -102,7 +123,7 @@ func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTable(ctx context.
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTableByX(ctx context.Context, in *GetExampleAutoIncrementTableByXRequest, opts ...grpc.CallOption) (*GetExampleAutoIncrementTableByXResponse, error) {
|
||||
out := new(GetExampleAutoIncrementTableByXResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTableByX", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -111,7 +132,7 @@ func (c *testSchemaQueryServiceClient) GetExampleAutoIncrementTableByX(ctx conte
|
||||
|
||||
func (c *testSchemaQueryServiceClient) ListExampleAutoIncrementTable(ctx context.Context, in *ListExampleAutoIncrementTableRequest, opts ...grpc.CallOption) (*ListExampleAutoIncrementTableResponse, error) {
|
||||
out := new(ListExampleAutoIncrementTableResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/ListExampleAutoIncrementTable", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -120,7 +141,7 @@ func (c *testSchemaQueryServiceClient) ListExampleAutoIncrementTable(ctx context
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleSingleton(ctx context.Context, in *GetExampleSingletonRequest, opts ...grpc.CallOption) (*GetExampleSingletonResponse, error) {
|
||||
out := new(GetExampleSingletonResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleSingleton", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleSingleton_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -129,7 +150,7 @@ func (c *testSchemaQueryServiceClient) GetExampleSingleton(ctx context.Context,
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleTimestamp(ctx context.Context, in *GetExampleTimestampRequest, opts ...grpc.CallOption) (*GetExampleTimestampResponse, error) {
|
||||
out := new(GetExampleTimestampResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleTimestamp", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleTimestamp_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -138,7 +159,7 @@ func (c *testSchemaQueryServiceClient) GetExampleTimestamp(ctx context.Context,
|
||||
|
||||
func (c *testSchemaQueryServiceClient) ListExampleTimestamp(ctx context.Context, in *ListExampleTimestampRequest, opts ...grpc.CallOption) (*ListExampleTimestampResponse, error) {
|
||||
out := new(ListExampleTimestampResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/ListExampleTimestamp", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleTimestamp_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -147,7 +168,7 @@ func (c *testSchemaQueryServiceClient) ListExampleTimestamp(ctx context.Context,
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleDuration(ctx context.Context, in *GetExampleDurationRequest, opts ...grpc.CallOption) (*GetExampleDurationResponse, error) {
|
||||
out := new(GetExampleDurationResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleDuration", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleDuration_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -156,7 +177,7 @@ func (c *testSchemaQueryServiceClient) GetExampleDuration(ctx context.Context, i
|
||||
|
||||
func (c *testSchemaQueryServiceClient) ListExampleDuration(ctx context.Context, in *ListExampleDurationRequest, opts ...grpc.CallOption) (*ListExampleDurationResponse, error) {
|
||||
out := new(ListExampleDurationResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/ListExampleDuration", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleDuration_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -165,7 +186,7 @@ func (c *testSchemaQueryServiceClient) ListExampleDuration(ctx context.Context,
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetSimpleExample(ctx context.Context, in *GetSimpleExampleRequest, opts ...grpc.CallOption) (*GetSimpleExampleResponse, error) {
|
||||
out := new(GetSimpleExampleResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetSimpleExample", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetSimpleExample_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -174,7 +195,7 @@ func (c *testSchemaQueryServiceClient) GetSimpleExample(ctx context.Context, in
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetSimpleExampleByUnique(ctx context.Context, in *GetSimpleExampleByUniqueRequest, opts ...grpc.CallOption) (*GetSimpleExampleByUniqueResponse, error) {
|
||||
out := new(GetSimpleExampleByUniqueResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetSimpleExampleByUnique", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -183,7 +204,7 @@ func (c *testSchemaQueryServiceClient) GetSimpleExampleByUnique(ctx context.Cont
|
||||
|
||||
func (c *testSchemaQueryServiceClient) ListSimpleExample(ctx context.Context, in *ListSimpleExampleRequest, opts ...grpc.CallOption) (*ListSimpleExampleResponse, error) {
|
||||
out := new(ListSimpleExampleResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/ListSimpleExample", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_ListSimpleExample_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -192,7 +213,7 @@ func (c *testSchemaQueryServiceClient) ListSimpleExample(ctx context.Context, in
|
||||
|
||||
func (c *testSchemaQueryServiceClient) GetExampleAutoIncFieldName(ctx context.Context, in *GetExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*GetExampleAutoIncFieldNameResponse, error) {
|
||||
out := new(GetExampleAutoIncFieldNameResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/GetExampleAutoIncFieldName", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -201,7 +222,7 @@ func (c *testSchemaQueryServiceClient) GetExampleAutoIncFieldName(ctx context.Co
|
||||
|
||||
func (c *testSchemaQueryServiceClient) ListExampleAutoIncFieldName(ctx context.Context, in *ListExampleAutoIncFieldNameRequest, opts ...grpc.CallOption) (*ListExampleAutoIncFieldNameResponse, error) {
|
||||
out := new(ListExampleAutoIncFieldNameResponse)
|
||||
err := c.cc.Invoke(ctx, "/testpb.TestSchemaQueryService/ListExampleAutoIncFieldName", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -323,7 +344,7 @@ func _TestSchemaQueryService_GetExampleTable_Handler(srv interface{}, ctx contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleTable",
|
||||
FullMethod: TestSchemaQueryService_GetExampleTable_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleTable(ctx, req.(*GetExampleTableRequest))
|
||||
@@ -341,7 +362,7 @@ func _TestSchemaQueryService_GetExampleTableByU64Str_Handler(srv interface{}, ct
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleTableByU64Str",
|
||||
FullMethod: TestSchemaQueryService_GetExampleTableByU64Str_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleTableByU64Str(ctx, req.(*GetExampleTableByU64StrRequest))
|
||||
@@ -359,7 +380,7 @@ func _TestSchemaQueryService_ListExampleTable_Handler(srv interface{}, ctx conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/ListExampleTable",
|
||||
FullMethod: TestSchemaQueryService_ListExampleTable_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).ListExampleTable(ctx, req.(*ListExampleTableRequest))
|
||||
@@ -377,7 +398,7 @@ func _TestSchemaQueryService_GetExampleAutoIncrementTable_Handler(srv interface{
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTable",
|
||||
FullMethod: TestSchemaQueryService_GetExampleAutoIncrementTable_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTable(ctx, req.(*GetExampleAutoIncrementTableRequest))
|
||||
@@ -395,7 +416,7 @@ func _TestSchemaQueryService_GetExampleAutoIncrementTableByX_Handler(srv interfa
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleAutoIncrementTableByX",
|
||||
FullMethod: TestSchemaQueryService_GetExampleAutoIncrementTableByX_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncrementTableByX(ctx, req.(*GetExampleAutoIncrementTableByXRequest))
|
||||
@@ -413,7 +434,7 @@ func _TestSchemaQueryService_ListExampleAutoIncrementTable_Handler(srv interface
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/ListExampleAutoIncrementTable",
|
||||
FullMethod: TestSchemaQueryService_ListExampleAutoIncrementTable_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncrementTable(ctx, req.(*ListExampleAutoIncrementTableRequest))
|
||||
@@ -431,7 +452,7 @@ func _TestSchemaQueryService_GetExampleSingleton_Handler(srv interface{}, ctx co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleSingleton",
|
||||
FullMethod: TestSchemaQueryService_GetExampleSingleton_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleSingleton(ctx, req.(*GetExampleSingletonRequest))
|
||||
@@ -449,7 +470,7 @@ func _TestSchemaQueryService_GetExampleTimestamp_Handler(srv interface{}, ctx co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleTimestamp",
|
||||
FullMethod: TestSchemaQueryService_GetExampleTimestamp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleTimestamp(ctx, req.(*GetExampleTimestampRequest))
|
||||
@@ -467,7 +488,7 @@ func _TestSchemaQueryService_ListExampleTimestamp_Handler(srv interface{}, ctx c
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/ListExampleTimestamp",
|
||||
FullMethod: TestSchemaQueryService_ListExampleTimestamp_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).ListExampleTimestamp(ctx, req.(*ListExampleTimestampRequest))
|
||||
@@ -485,7 +506,7 @@ func _TestSchemaQueryService_GetExampleDuration_Handler(srv interface{}, ctx con
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleDuration",
|
||||
FullMethod: TestSchemaQueryService_GetExampleDuration_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleDuration(ctx, req.(*GetExampleDurationRequest))
|
||||
@@ -503,7 +524,7 @@ func _TestSchemaQueryService_ListExampleDuration_Handler(srv interface{}, ctx co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/ListExampleDuration",
|
||||
FullMethod: TestSchemaQueryService_ListExampleDuration_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).ListExampleDuration(ctx, req.(*ListExampleDurationRequest))
|
||||
@@ -521,7 +542,7 @@ func _TestSchemaQueryService_GetSimpleExample_Handler(srv interface{}, ctx conte
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetSimpleExample",
|
||||
FullMethod: TestSchemaQueryService_GetSimpleExample_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetSimpleExample(ctx, req.(*GetSimpleExampleRequest))
|
||||
@@ -539,7 +560,7 @@ func _TestSchemaQueryService_GetSimpleExampleByUnique_Handler(srv interface{}, c
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetSimpleExampleByUnique",
|
||||
FullMethod: TestSchemaQueryService_GetSimpleExampleByUnique_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetSimpleExampleByUnique(ctx, req.(*GetSimpleExampleByUniqueRequest))
|
||||
@@ -557,7 +578,7 @@ func _TestSchemaQueryService_ListSimpleExample_Handler(srv interface{}, ctx cont
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/ListSimpleExample",
|
||||
FullMethod: TestSchemaQueryService_ListSimpleExample_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).ListSimpleExample(ctx, req.(*ListSimpleExampleRequest))
|
||||
@@ -575,7 +596,7 @@ func _TestSchemaQueryService_GetExampleAutoIncFieldName_Handler(srv interface{},
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/GetExampleAutoIncFieldName",
|
||||
FullMethod: TestSchemaQueryService_GetExampleAutoIncFieldName_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).GetExampleAutoIncFieldName(ctx, req.(*GetExampleAutoIncFieldNameRequest))
|
||||
@@ -593,7 +614,7 @@ func _TestSchemaQueryService_ListExampleAutoIncFieldName_Handler(srv interface{}
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/testpb.TestSchemaQueryService/ListExampleAutoIncFieldName",
|
||||
FullMethod: TestSchemaQueryService_ListExampleAutoIncFieldName_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(TestSchemaQueryServiceServer).ListExampleAutoIncFieldName(ctx, req.(*ListExampleAutoIncFieldNameRequest))
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormfield"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/encoding/ormfield"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
)
|
||||
|
||||
// TestFieldSpec defines a test field against the testpb.ExampleTable message.
|
||||
|
||||
@@ -6,17 +6,14 @@ import (
|
||||
"errors"
|
||||
"math"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type fileDescriptorDBOptions struct {
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
"cosmossdk.io/errors"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type appModuleGenesisWrapper struct {
|
||||
|
||||
@@ -9,21 +9,17 @@ import (
|
||||
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/store"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protodesc"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
"google.golang.org/protobuf/reflect/protoregistry"
|
||||
|
||||
ormv1alpha1 "cosmossdk.io/api/cosmos/orm/v1alpha1"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protodesc"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// ModuleDB defines the ORM database type to be used by modules.
|
||||
|
||||
@@ -15,24 +15,21 @@ import (
|
||||
"cosmossdk.io/core/appmodule"
|
||||
"cosmossdk.io/core/genesis"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/depinject"
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
|
||||
"cosmossdk.io/depinject"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/testing/ormmocks"
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
"gotest.tools/v3/golden"
|
||||
|
||||
_ "github.com/cosmos/cosmos-sdk/orm" // required for ORM module registration
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormdb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"github.com/cosmos/cosmos-sdk/orm/testing/ormtest"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
_ "cosmossdk.io/orm" // required for ORM module registration
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/model/ormdb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/testing/ormmocks"
|
||||
"cosmossdk.io/orm/testing/ormtest"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// These tests use a simulated bank keeper. Addresses and balances use
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/listinternal"
|
||||
"cosmossdk.io/orm/internal/listinternal"
|
||||
)
|
||||
|
||||
// Option represents a list option.
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// autoIncrementTable is a Table implementation for tables with an
|
||||
|
||||
@@ -10,9 +10,9 @@ import (
|
||||
"gotest.tools/v3/assert"
|
||||
"gotest.tools/v3/golden"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
func TestAutoIncrementScenario(t *testing.T) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
)
|
||||
|
||||
// ReadBackend defines the type used for read-only ORM operations.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package ormtable
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
)
|
||||
|
||||
type batchIndexCommitmentWriter struct {
|
||||
|
||||
@@ -7,15 +7,14 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/testing/ormtest"
|
||||
|
||||
dbm "github.com/cosmos/cosmos-db"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/testing/ormtest"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
)
|
||||
|
||||
func initBalanceTable(t testing.TB) testpb.BalanceTable {
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
|
||||
ormv1 "cosmossdk.io/api/cosmos/orm/v1"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/fieldnames"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"google.golang.org/protobuf/types/known/durationpb"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
func TestDurationIndex(t *testing.T) {
|
||||
|
||||
@@ -3,13 +3,12 @@ package ormtable
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormlist"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/model/ormlist"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
)
|
||||
|
||||
// Index defines an index on a table. Index instances
|
||||
|
||||
@@ -3,18 +3,14 @@ package ormtable
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormlist"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/fieldnames"
|
||||
"cosmossdk.io/orm/model/ormlist"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// indexKeyIndex implements Index for a regular IndexKey.
|
||||
|
||||
@@ -5,11 +5,11 @@ import (
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/listinternal"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormlist"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/listinternal"
|
||||
"cosmossdk.io/orm/model/ormlist"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
)
|
||||
|
||||
// Iterator defines the interface for iterating over indexes.
|
||||
|
||||
@@ -3,7 +3,7 @@ package ormtable
|
||||
import (
|
||||
"math"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/listinternal"
|
||||
"cosmossdk.io/orm/internal/listinternal"
|
||||
|
||||
queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1"
|
||||
)
|
||||
|
||||
@@ -3,18 +3,14 @@ package ormtable
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormlist"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/fieldnames"
|
||||
"cosmossdk.io/orm/model/ormlist"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// primaryKeyIndex defines an UniqueIndex for the primary key.
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
@@ -13,8 +12,9 @@ import (
|
||||
"github.com/regen-network/gocuke"
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/testing/ormtest"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/testing/ormtest"
|
||||
)
|
||||
|
||||
func TestSave(t *testing.T) {
|
||||
|
||||
@@ -4,14 +4,13 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
|
||||
"google.golang.org/protobuf/testing/protocmp"
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
func TestSingleton(t *testing.T) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
)
|
||||
|
||||
// View defines a read-only table.
|
||||
|
||||
@@ -8,14 +8,13 @@ import (
|
||||
"io"
|
||||
"math"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
|
||||
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/fieldnames"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
// tableImpl implements Table.
|
||||
|
||||
@@ -17,18 +17,17 @@ import (
|
||||
"gotest.tools/v3/golden"
|
||||
"pgregory.net/rapid"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
|
||||
queryv1beta1 "cosmossdk.io/api/cosmos/base/query/v1beta1"
|
||||
sdkerrors "cosmossdk.io/errors"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testutil"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormlist"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/internal/testutil"
|
||||
"cosmossdk.io/orm/model/ormlist"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
func TestScenario(t *testing.T) {
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
|
||||
"gotest.tools/v3/assert"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testpb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/internal/testpb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
func TestTimestampIndex(t *testing.T) {
|
||||
|
||||
@@ -3,19 +3,15 @@ package ormtable
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/kv"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/fieldnames"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormlist"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/encodeutil"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/encoding/ormkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/types/ormerrors"
|
||||
"cosmossdk.io/orm/encoding/encodeutil"
|
||||
"cosmossdk.io/orm/encoding/ormkv"
|
||||
"cosmossdk.io/orm/internal/fieldnames"
|
||||
"cosmossdk.io/orm/model/ormlist"
|
||||
"cosmossdk.io/orm/types/kv"
|
||||
"cosmossdk.io/orm/types/ormerrors"
|
||||
)
|
||||
|
||||
type uniqueKeyIndex struct {
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ import (
|
||||
|
||||
"cosmossdk.io/depinject"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormdb"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/model/ormdb"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
package ormtest
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/orm/internal/testkv"
|
||||
"github.com/cosmos/cosmos-sdk/orm/model/ormtable"
|
||||
"cosmossdk.io/orm/internal/testkv"
|
||||
"cosmossdk.io/orm/model/ormtable"
|
||||
)
|
||||
|
||||
// NewMemoryBackend returns a new ORM memory backend which can be used for
|
||||
|
||||
@@ -9,6 +9,6 @@ import "cosmos/app/v1alpha1/module.proto";
|
||||
// services for modules that use the ORM.
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import: "github.com/cosmos/cosmos-sdk/orm"
|
||||
go_import: "cosmossdk.io/orm"
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user