Documentation ¶
Index ¶
- Variables
- type FieldDbType
- func (FieldDbType) Descriptor() protoreflect.EnumDescriptor
- func (x FieldDbType) Enum() *FieldDbType
- func (FieldDbType) EnumDescriptor() ([]byte, []int)deprecated
- func (x FieldDbType) Number() protoreflect.EnumNumber
- func (x FieldDbType) String() string
- func (FieldDbType) Type() protoreflect.EnumType
- type PDBField
- func (*PDBField) Descriptor() ([]byte, []int)deprecated
- func (x *PDBField) GetDbType() FieldDbType
- func (x *PDBField) GetDbTypeStr() string
- func (x *PDBField) GetDefaultValue() string
- func (x *PDBField) GetNoUpdate() bool
- func (x *PDBField) GetNotDB() bool
- func (x *PDBField) GetNotNull() bool
- func (x *PDBField) GetPrimary() bool
- func (x *PDBField) GetReference() string
- func (x *PDBField) GetSQLAppend() []string
- func (x *PDBField) GetSQLAppendsEnd() []string
- func (x *PDBField) GetSerialType() int32
- func (x *PDBField) GetUnique() bool
- func (x *PDBField) GetZeroAsNull() bool
- func (*PDBField) ProtoMessage()
- func (x *PDBField) ProtoReflect() protoreflect.Message
- func (x *PDBField) Reset()
- func (x *PDBField) String() string
- type PDBFile
- type PDBMsg
- func (*PDBMsg) Descriptor() ([]byte, []int)deprecated
- func (x *PDBMsg) GetMsgList() int32
- func (x *PDBMsg) GetPrimary() []string
- func (x *PDBMsg) GetSQLAppend() []string
- func (x *PDBMsg) GetSQLAppendsAfter() []string
- func (x *PDBMsg) GetSQLAppendsEnd() []string
- func (x *PDBMsg) GetSQLPrepend() []string
- func (*PDBMsg) ProtoMessage()
- func (x *PDBMsg) ProtoReflect() protoreflect.Message
- func (x *PDBMsg) Reset()
- func (x *PDBMsg) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FieldDbType_name = map[int32]string{ 0: "AutoMatch", 1: "BOOL", 2: "INT32", 3: "INT64", 4: "FLOAT", 5: "DOUBLE", 6: "TEXT", 7: "JSONB", 8: "UUID", 9: "TIMESTAMP", 10: "DATE", 11: "BYTEA", 12: "INET", } FieldDbType_value = map[string]int32{ "AutoMatch": 0, "BOOL": 1, "INT32": 2, "INT64": 3, "FLOAT": 4, "DOUBLE": 5, "TEXT": 6, "JSONB": 7, "UUID": 8, "TIMESTAMP": 9, "DATE": 10, "BYTEA": 11, "INET": 12, } )
Enum value maps for FieldDbType.
View Source
var (
// optional protodb.PDBField pdb = 1888;
E_Pdb = &file_protodb_proto_extTypes[2]
)
Extension fields to descriptorpb.FieldOptions.
View Source
var (
// optional protodb.PDBFile pdbf = 1888;
E_Pdbf = &file_protodb_proto_extTypes[0]
)
Extension fields to descriptorpb.FileOptions.
View Source
var (
// optional protodb.PDBMsg pdbm = 1888;
E_Pdbm = &file_protodb_proto_extTypes[1]
)
Extension fields to descriptorpb.MessageOptions.
View Source
var File_protodb_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type FieldDbType ¶ added in v0.1.3
type FieldDbType int32
const ( // auto match db type if DbTypeStr not set // pb type -> db type // bool -> bool // string -> text // int32 -> int // int64,uint32 -> bigint // float -> float // double -> double precision // bytes -> bytea FieldDbType_AutoMatch FieldDbType = 0 FieldDbType_BOOL FieldDbType = 1 FieldDbType_INT32 FieldDbType = 2 FieldDbType_INT64 FieldDbType = 3 FieldDbType_FLOAT FieldDbType = 4 FieldDbType_DOUBLE FieldDbType = 5 FieldDbType_TEXT FieldDbType = 6 FieldDbType_JSONB FieldDbType = 7 FieldDbType_UUID FieldDbType = 8 FieldDbType_TIMESTAMP FieldDbType = 9 FieldDbType_DATE FieldDbType = 10 FieldDbType_BYTEA FieldDbType = 11 // ipv4 or ipv6 address FieldDbType_INET FieldDbType = 12 )
func (FieldDbType) Descriptor ¶ added in v0.1.3
func (FieldDbType) Descriptor() protoreflect.EnumDescriptor
func (FieldDbType) Enum ¶ added in v0.1.3
func (x FieldDbType) Enum() *FieldDbType
func (FieldDbType) EnumDescriptor
deprecated
added in
v0.1.3
func (FieldDbType) EnumDescriptor() ([]byte, []int)
Deprecated: Use FieldDbType.Descriptor instead.
func (FieldDbType) Number ¶ added in v0.1.3
func (x FieldDbType) Number() protoreflect.EnumNumber
func (FieldDbType) String ¶ added in v0.1.3
func (x FieldDbType) String() string
func (FieldDbType) Type ¶ added in v0.1.3
func (FieldDbType) Type() protoreflect.EnumType
type PDBField ¶
type PDBField struct { // do not generate db field in create table // when in update, do not update this field NotDB bool `protobuf:"varint,1,opt,name=NotDB,proto3" json:"NotDB,omitempty"` // is primary key Primary bool `protobuf:"varint,2,opt,name=Primary,proto3" json:"Primary,omitempty"` // is unique key Unique bool `protobuf:"varint,3,opt,name=Unique,proto3" json:"Unique,omitempty"` // is not null NotNull bool `protobuf:"varint,4,opt,name=NotNull,proto3" json:"NotNull,omitempty"` // reference to other table, sql like: REFERENCES other_table(other_field) Reference string `protobuf:"bytes,5,opt,name=Reference,proto3" json:"Reference,omitempty"` // default value DefaultValue string `protobuf:"bytes,6,opt,name=DefaultValue,proto3" json:"DefaultValue,omitempty"` // append sql before , SQLAppend []string `protobuf:"bytes,7,rep,name=SQLAppend,proto3" json:"SQLAppend,omitempty"` // append sql after , SQLAppendsEnd []string `protobuf:"bytes,8,rep,name=SQLAppendsEnd,proto3" json:"SQLAppendsEnd,omitempty"` // db no update // when in update, do not update this field, for example, create time NoUpdate bool `protobuf:"varint,9,opt,name=NoUpdate,proto3" json:"NoUpdate,omitempty"` // serial type 0:not serial type 1:smallint 4:int 8:bigint // strong advice not use serial type,it's hard in distributed system SerialType int32 `protobuf:"varint,10,opt,name=SerialType,proto3" json:"SerialType,omitempty"` // db type DbType FieldDbType `protobuf:"varint,11,opt,name=DbType,proto3,enum=protodb.FieldDbType" json:"DbType,omitempty"` // use custom db type when DbType is not good fit DbTypeStr string `protobuf:"bytes,12,opt,name=DbTypeStr,proto3" json:"DbTypeStr,omitempty"` // zero value treat as null for insert,update, especially for reference field ZeroAsNull bool `protobuf:"varint,13,opt,name=ZeroAsNull,proto3" json:"ZeroAsNull,omitempty"` // contains filtered or unexported fields }
func (*PDBField) Descriptor
deprecated
func (*PDBField) GetDbType ¶ added in v0.1.3
func (x *PDBField) GetDbType() FieldDbType
func (*PDBField) GetDbTypeStr ¶ added in v0.1.3
func (*PDBField) GetDefaultValue ¶
func (*PDBField) GetNoUpdate ¶
func (*PDBField) GetNotNull ¶ added in v0.1.3
func (*PDBField) GetPrimary ¶ added in v0.1.3
func (*PDBField) GetReference ¶
func (*PDBField) GetSQLAppend ¶ added in v0.1.3
func (*PDBField) GetSQLAppendsEnd ¶
func (*PDBField) GetSerialType ¶
func (*PDBField) GetZeroAsNull ¶ added in v0.1.3
func (*PDBField) ProtoMessage ¶
func (*PDBField) ProtoMessage()
func (*PDBField) ProtoReflect ¶
func (x *PDBField) ProtoReflect() protoreflect.Message
type PDBFile ¶
type PDBFile struct { // name style(msg & field) // empty='go': default, go name style, better performance in crud operation in // go (like: UserName) 'snake': snake name style (like: user_name) NameStyle string `protobuf:"bytes,1,opt,name=NameStyle,proto3" json:"NameStyle,omitempty"` // contains filtered or unexported fields }
func (*PDBFile) Descriptor
deprecated
func (*PDBFile) GetNameStyle ¶
func (*PDBFile) ProtoMessage ¶
func (*PDBFile) ProtoMessage()
func (*PDBFile) ProtoReflect ¶
func (x *PDBFile) ProtoReflect() protoreflect.Message
type PDBMsg ¶
type PDBMsg struct { // when table primary key include more than one field,need specify the primary // key in pdbmsg Primary []string `protobuf:"bytes,1,rep,name=Primary,proto3" json:"Primary,omitempty"` // sql prepends before create table SQLPrepend []string `protobuf:"bytes,2,rep,name=SQLPrepend,proto3" json:"SQLPrepend,omitempty"` // sql appends before ) SQLAppend []string `protobuf:"bytes,3,rep,name=SQLAppend,proto3" json:"SQLAppend,omitempty"` // sql appends after ) before ; SQLAppendsAfter []string `protobuf:"bytes,4,rep,name=SQLAppendsAfter,proto3" json:"SQLAppendsAfter,omitempty"` // sql appends after ; SQLAppendsEnd []string `protobuf:"bytes,5,rep,name=SQLAppendsEnd,proto3" json:"SQLAppendsEnd,omitempty"` // generate proto msg { {msg}}List in xxx.list.proto // 0: auto if msg name start with db then generate { {msg}}List // 1: always generate { {msg}}List // 4: never generate { {msg}}List MsgList int32 `protobuf:"varint,6,opt,name=MsgList,proto3" json:"MsgList,omitempty"` // contains filtered or unexported fields }
func (*PDBMsg) Descriptor
deprecated
func (*PDBMsg) GetMsgList ¶ added in v0.1.1
func (*PDBMsg) GetPrimary ¶ added in v0.1.3
func (*PDBMsg) GetSQLAppend ¶ added in v0.1.3
func (*PDBMsg) GetSQLAppendsAfter ¶
func (*PDBMsg) GetSQLAppendsEnd ¶
func (*PDBMsg) GetSQLPrepend ¶ added in v0.1.3
func (*PDBMsg) ProtoMessage ¶
func (*PDBMsg) ProtoMessage()
func (*PDBMsg) ProtoReflect ¶
func (x *PDBMsg) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.