db

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: Apache-2.0 Imports: 12 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_db_proto protoreflect.FileDescriptor

Functions

func NewDbEndpoints

func NewDbEndpoints() []*api.Endpoint

func RegisterDbHandler

func RegisterDbHandler(s server.Server, hdlr DbHandler, opts ...server.HandlerOption) error

Types

type CountRequest added in v0.21.0

type CountRequest struct {

	// specify the table name
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// contains filtered or unexported fields
}

Count records in a table

func (*CountRequest) Descriptor deprecated added in v0.21.0

func (*CountRequest) Descriptor() ([]byte, []int)

Deprecated: Use CountRequest.ProtoReflect.Descriptor instead.

func (*CountRequest) GetTable added in v0.21.0

func (x *CountRequest) GetTable() string

func (*CountRequest) ProtoMessage added in v0.21.0

func (*CountRequest) ProtoMessage()

func (*CountRequest) ProtoReflect added in v0.21.0

func (x *CountRequest) ProtoReflect() protoreflect.Message

func (*CountRequest) Reset added in v0.21.0

func (x *CountRequest) Reset()

func (*CountRequest) String added in v0.21.0

func (x *CountRequest) String() string

type CountResponse added in v0.21.0

type CountResponse struct {

	// the number of records in the table
	Count int32 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*CountResponse) Descriptor deprecated added in v0.21.0

func (*CountResponse) Descriptor() ([]byte, []int)

Deprecated: Use CountResponse.ProtoReflect.Descriptor instead.

func (*CountResponse) GetCount added in v0.21.0

func (x *CountResponse) GetCount() int32

func (*CountResponse) ProtoMessage added in v0.21.0

func (*CountResponse) ProtoMessage()

func (*CountResponse) ProtoReflect added in v0.21.0

func (x *CountResponse) ProtoReflect() protoreflect.Message

func (*CountResponse) Reset added in v0.21.0

func (x *CountResponse) Reset()

func (*CountResponse) String added in v0.21.0

func (x *CountResponse) String() string

type CreateRequest

type CreateRequest struct {

	// Optional table name. Defaults to 'default'
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// JSON encoded record or records (can be array or object)
	Record *structpb.Struct `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"`
	// optional record id to use
	Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Create a record in the database. Optionally include an "id" field otherwise it's set automatically.

func (*CreateRequest) Descriptor deprecated

func (*CreateRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetId added in v0.24.0

func (x *CreateRequest) GetId() string

func (*CreateRequest) GetRecord

func (x *CreateRequest) GetRecord() *structpb.Struct

func (*CreateRequest) GetTable

func (x *CreateRequest) GetTable() string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

func (x *CreateRequest) ProtoReflect() protoreflect.Message

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {

	// The id of the record (either specified or automatically created)
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

func (*CreateResponse) Descriptor() ([]byte, []int)

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetId

func (x *CreateResponse) GetId() string

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

func (x *CreateResponse) ProtoReflect() protoreflect.Message

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// Optional table name. Defaults to 'default'
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// id of the record
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

Delete a record in the database by id.

func (*DeleteRequest) Descriptor deprecated

func (*DeleteRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetId

func (x *DeleteRequest) GetId() string

func (*DeleteRequest) GetTable

func (x *DeleteRequest) GetTable() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

func (x *DeleteRequest) ProtoReflect() protoreflect.Message

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

func (*DeleteResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

func (x *DeleteResponse) ProtoReflect() protoreflect.Message

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type DropTableRequest added in v0.23.0

type DropTableRequest struct {
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// contains filtered or unexported fields
}

Drop a table in the DB

func (*DropTableRequest) Descriptor deprecated added in v0.23.0

func (*DropTableRequest) Descriptor() ([]byte, []int)

Deprecated: Use DropTableRequest.ProtoReflect.Descriptor instead.

func (*DropTableRequest) GetTable added in v0.23.0

func (x *DropTableRequest) GetTable() string

func (*DropTableRequest) ProtoMessage added in v0.23.0

func (*DropTableRequest) ProtoMessage()

func (*DropTableRequest) ProtoReflect added in v0.23.0

func (x *DropTableRequest) ProtoReflect() protoreflect.Message

func (*DropTableRequest) Reset added in v0.23.0

func (x *DropTableRequest) Reset()

func (*DropTableRequest) String added in v0.23.0

func (x *DropTableRequest) String() string

type DropTableResponse added in v0.23.0

type DropTableResponse struct {
	// contains filtered or unexported fields
}

func (*DropTableResponse) Descriptor deprecated added in v0.23.0

func (*DropTableResponse) Descriptor() ([]byte, []int)

Deprecated: Use DropTableResponse.ProtoReflect.Descriptor instead.

func (*DropTableResponse) ProtoMessage added in v0.23.0

func (*DropTableResponse) ProtoMessage()

func (*DropTableResponse) ProtoReflect added in v0.23.0

func (x *DropTableResponse) ProtoReflect() protoreflect.Message

func (*DropTableResponse) Reset added in v0.23.0

func (x *DropTableResponse) Reset()

func (*DropTableResponse) String added in v0.23.0

func (x *DropTableResponse) String() string

type ListTablesRequest added in v0.22.0

type ListTablesRequest struct {
	// contains filtered or unexported fields
}

List tables in the DB

func (*ListTablesRequest) Descriptor deprecated added in v0.22.0

func (*ListTablesRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListTablesRequest.ProtoReflect.Descriptor instead.

func (*ListTablesRequest) ProtoMessage added in v0.22.0

func (*ListTablesRequest) ProtoMessage()

func (*ListTablesRequest) ProtoReflect added in v0.22.0

func (x *ListTablesRequest) ProtoReflect() protoreflect.Message

func (*ListTablesRequest) Reset added in v0.22.0

func (x *ListTablesRequest) Reset()

func (*ListTablesRequest) String added in v0.22.0

func (x *ListTablesRequest) String() string

type ListTablesResponse added in v0.22.0

type ListTablesResponse struct {

	// list of tables
	Tables []string `protobuf:"bytes,1,rep,name=tables,proto3" json:"tables,omitempty"`
	// contains filtered or unexported fields
}

func (*ListTablesResponse) Descriptor deprecated added in v0.22.0

func (*ListTablesResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListTablesResponse.ProtoReflect.Descriptor instead.

func (*ListTablesResponse) GetTables added in v0.22.0

func (x *ListTablesResponse) GetTables() []string

func (*ListTablesResponse) ProtoMessage added in v0.22.0

func (*ListTablesResponse) ProtoMessage()

func (*ListTablesResponse) ProtoReflect added in v0.22.0

func (x *ListTablesResponse) ProtoReflect() protoreflect.Message

func (*ListTablesResponse) Reset added in v0.22.0

func (x *ListTablesResponse) Reset()

func (*ListTablesResponse) String added in v0.22.0

func (x *ListTablesResponse) String() string

type ReadRequest

type ReadRequest struct {

	// Optional table name. Defaults to 'default'
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// Read by id. Equivalent to 'id == "your-id"'
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// Examples: 'age >= 18', 'age >= 18 and verified == true'
	// Comparison operators: '==', '!=', '<', '>', '<=', '>='
	// Logical operator: 'and'
	// Dot access is supported, eg: 'user.age == 11'
	// Accessing list elements is not supported yet.
	Query  string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
	Offset int32  `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
	// Maximum number of records to return. Default limit is 25.
	// Maximum limit is 1000. Anything higher will return an error.
	Limit int32 `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// field name to order by
	OrderBy string `protobuf:"bytes,6,opt,name=orderBy,proto3" json:"orderBy,omitempty"`
	// 'asc' (default), 'desc'
	Order string `protobuf:"bytes,7,opt,name=order,proto3" json:"order,omitempty"`
	// contains filtered or unexported fields
}

Read data from a table. Lookup can be by ID or via querying any field in the record.

func (*ReadRequest) Descriptor deprecated

func (*ReadRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.

func (*ReadRequest) GetId

func (x *ReadRequest) GetId() string

func (*ReadRequest) GetLimit

func (x *ReadRequest) GetLimit() int32

func (*ReadRequest) GetOffset

func (x *ReadRequest) GetOffset() int32

func (*ReadRequest) GetOrder

func (x *ReadRequest) GetOrder() string

func (*ReadRequest) GetOrderBy

func (x *ReadRequest) GetOrderBy() string

func (*ReadRequest) GetQuery

func (x *ReadRequest) GetQuery() string

func (*ReadRequest) GetTable

func (x *ReadRequest) GetTable() string

func (*ReadRequest) ProtoMessage

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) ProtoReflect

func (x *ReadRequest) ProtoReflect() protoreflect.Message

func (*ReadRequest) Reset

func (x *ReadRequest) Reset()

func (*ReadRequest) String

func (x *ReadRequest) String() string

type ReadResponse

type ReadResponse struct {

	// JSON encoded records
	Records []*structpb.Struct `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
	// contains filtered or unexported fields
}

func (*ReadResponse) Descriptor deprecated

func (*ReadResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.

func (*ReadResponse) GetRecords

func (x *ReadResponse) GetRecords() []*structpb.Struct

func (*ReadResponse) ProtoMessage

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) ProtoReflect

func (x *ReadResponse) ProtoReflect() protoreflect.Message

func (*ReadResponse) Reset

func (x *ReadResponse) Reset()

func (*ReadResponse) String

func (x *ReadResponse) String() string

type RenameTableRequest added in v0.22.0

type RenameTableRequest struct {

	// current table name
	From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
	// new table name
	To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
	// contains filtered or unexported fields
}

Rename a table

func (*RenameTableRequest) Descriptor deprecated added in v0.22.0

func (*RenameTableRequest) Descriptor() ([]byte, []int)

Deprecated: Use RenameTableRequest.ProtoReflect.Descriptor instead.

func (*RenameTableRequest) GetFrom added in v0.22.0

func (x *RenameTableRequest) GetFrom() string

func (*RenameTableRequest) GetTo added in v0.22.0

func (x *RenameTableRequest) GetTo() string

func (*RenameTableRequest) ProtoMessage added in v0.22.0

func (*RenameTableRequest) ProtoMessage()

func (*RenameTableRequest) ProtoReflect added in v0.22.0

func (x *RenameTableRequest) ProtoReflect() protoreflect.Message

func (*RenameTableRequest) Reset added in v0.22.0

func (x *RenameTableRequest) Reset()

func (*RenameTableRequest) String added in v0.22.0

func (x *RenameTableRequest) String() string

type RenameTableResponse added in v0.22.0

type RenameTableResponse struct {
	// contains filtered or unexported fields
}

func (*RenameTableResponse) Descriptor deprecated added in v0.22.0

func (*RenameTableResponse) Descriptor() ([]byte, []int)

Deprecated: Use RenameTableResponse.ProtoReflect.Descriptor instead.

func (*RenameTableResponse) ProtoMessage added in v0.22.0

func (*RenameTableResponse) ProtoMessage()

func (*RenameTableResponse) ProtoReflect added in v0.22.0

func (x *RenameTableResponse) ProtoReflect() protoreflect.Message

func (*RenameTableResponse) Reset added in v0.22.0

func (x *RenameTableResponse) Reset()

func (*RenameTableResponse) String added in v0.22.0

func (x *RenameTableResponse) String() string

type TruncateRequest

type TruncateRequest struct {
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// contains filtered or unexported fields
}

Truncate the records in a table

func (*TruncateRequest) Descriptor deprecated

func (*TruncateRequest) Descriptor() ([]byte, []int)

Deprecated: Use TruncateRequest.ProtoReflect.Descriptor instead.

func (*TruncateRequest) GetTable

func (x *TruncateRequest) GetTable() string

func (*TruncateRequest) ProtoMessage

func (*TruncateRequest) ProtoMessage()

func (*TruncateRequest) ProtoReflect

func (x *TruncateRequest) ProtoReflect() protoreflect.Message

func (*TruncateRequest) Reset

func (x *TruncateRequest) Reset()

func (*TruncateRequest) String

func (x *TruncateRequest) String() string

type TruncateResponse

type TruncateResponse struct {
	// contains filtered or unexported fields
}

func (*TruncateResponse) Descriptor deprecated

func (*TruncateResponse) Descriptor() ([]byte, []int)

Deprecated: Use TruncateResponse.ProtoReflect.Descriptor instead.

func (*TruncateResponse) ProtoMessage

func (*TruncateResponse) ProtoMessage()

func (*TruncateResponse) ProtoReflect

func (x *TruncateResponse) ProtoReflect() protoreflect.Message

func (*TruncateResponse) Reset

func (x *TruncateResponse) Reset()

func (*TruncateResponse) String

func (x *TruncateResponse) String() string

type UpdateRequest

type UpdateRequest struct {

	// Optional table name. Defaults to 'default'
	Table string `protobuf:"bytes,1,opt,name=table,proto3" json:"table,omitempty"`
	// The id of the record. If not specified it is inferred from the 'id' field of the record
	Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// record, JSON object
	Record *structpb.Struct `protobuf:"bytes,3,opt,name=record,proto3" json:"record,omitempty"`
	// contains filtered or unexported fields
}

Update a record in the database. Include an "id" in the record to update.

func (*UpdateRequest) Descriptor deprecated

func (*UpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.

func (*UpdateRequest) GetId

func (x *UpdateRequest) GetId() string

func (*UpdateRequest) GetRecord

func (x *UpdateRequest) GetRecord() *structpb.Struct

func (*UpdateRequest) GetTable

func (x *UpdateRequest) GetTable() string

func (*UpdateRequest) ProtoMessage

func (*UpdateRequest) ProtoMessage()

func (*UpdateRequest) ProtoReflect

func (x *UpdateRequest) ProtoReflect() protoreflect.Message

func (*UpdateRequest) Reset

func (x *UpdateRequest) Reset()

func (*UpdateRequest) String

func (x *UpdateRequest) String() string

type UpdateResponse

type UpdateResponse struct {
	// contains filtered or unexported fields
}

func (*UpdateResponse) Descriptor deprecated

func (*UpdateResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.

func (*UpdateResponse) ProtoMessage

func (*UpdateResponse) ProtoMessage()

func (*UpdateResponse) ProtoReflect

func (x *UpdateResponse) ProtoReflect() protoreflect.Message

func (*UpdateResponse) Reset

func (x *UpdateResponse) Reset()

func (*UpdateResponse) String

func (x *UpdateResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL