Documentation
¶
Index ¶
- Constants
- Variables
- type FieldOpts
- func (x *FieldOpts) ClearJoin()
- func (x *FieldOpts) GetAsJsonBytes() bool
- func (x *FieldOpts) GetAsProtoBytes() bool
- func (x *FieldOpts) GetColumnName() string
- func (x *FieldOpts) GetEmbed() bool
- func (x *FieldOpts) GetJoin() *Join
- func (x *FieldOpts) GetNullable() bool
- func (x *FieldOpts) GetPgVector() bool
- func (x *FieldOpts) GetSkip() bool
- func (x *FieldOpts) HasJoin() bool
- func (*FieldOpts) ProtoMessage()
- func (x *FieldOpts) ProtoReflect() protoreflect.Message
- func (x *FieldOpts) Reset()
- func (x *FieldOpts) SetAsJsonBytes(v bool)
- func (x *FieldOpts) SetAsProtoBytes(v bool)
- func (x *FieldOpts) SetColumnName(v string)
- func (x *FieldOpts) SetEmbed(v bool)
- func (x *FieldOpts) SetJoin(v *Join)
- func (x *FieldOpts) SetNullable(v bool)
- func (x *FieldOpts) SetPgVector(v bool)
- func (x *FieldOpts) SetSkip(v bool)
- func (x *FieldOpts) String() string
- type FieldOpts_builder
- type Join
- func (x *Join) ClearQuery()
- func (x *Join) ClearReference()
- func (x *Join) ClearSelector()
- func (x *Join) GetField() string
- func (x *Join) GetQuery() *Query
- func (x *Join) GetReference() string
- func (x *Join) GetResourceType() string
- func (x *Join) GetSelector() isJoin_Selector
- func (x *Join) HasQuery() bool
- func (x *Join) HasReference() bool
- func (x *Join) HasSelector() bool
- func (*Join) ProtoMessage()
- func (x *Join) ProtoReflect() protoreflect.Message
- func (x *Join) Reset()
- func (x *Join) SetField(v string)
- func (x *Join) SetQuery(v *Query)
- func (x *Join) SetReference(v string)
- func (x *Join) SetResourceType(v string)
- func (x *Join) String() string
- func (x *Join) WhichSelector() case_Join_Selector
- type Join_Query
- type Join_Reference
- type Join_builder
- type ModelOpts
- func (x *ModelOpts) GetIdColumnName() string
- func (x *ModelOpts) GetSchemaName() string
- func (x *ModelOpts) GetTableName() string
- func (*ModelOpts) ProtoMessage()
- func (x *ModelOpts) ProtoReflect() protoreflect.Message
- func (x *ModelOpts) Reset()
- func (x *ModelOpts) SetIdColumnName(v string)
- func (x *ModelOpts) SetSchemaName(v string)
- func (x *ModelOpts) SetTableName(v string)
- func (x *ModelOpts) String() string
- type ModelOpts_builder
- type Query
- type Query_builder
Constants ¶
const Join_Query_case case_Join_Selector = 4
const Join_Reference_case case_Join_Selector = 3
const Join_Selector_not_set_case case_Join_Selector = 0
Variables ¶
var ( // Opts for a field. // // optional malonaz.codegen.model.v1.FieldOpts field_opts = 32423; E_FieldOpts = &file_malonaz_codegen_model_v1_model_proto_extTypes[1] )
Extension fields to descriptorpb.FieldOptions.
var ( // Opts for a model. // // optional malonaz.codegen.model.v1.ModelOpts model_opts = 8810; E_ModelOpts = &file_malonaz_codegen_model_v1_model_proto_extTypes[0] )
Extension fields to descriptorpb.MessageOptions.
var File_malonaz_codegen_model_v1_model_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type FieldOpts ¶
type FieldOpts struct {
// Override the column name for this field.
ColumnName string `protobuf:"bytes,1,opt,name=column_name,json=columnName,proto3" json:"column_name,omitempty"`
// If true, serialize this field as JSON bytes in the database.
// The field will be stored as JSONB and marshaled/unmarshaled using JSON encoding.
AsJsonBytes bool `protobuf:"varint,2,opt,name=as_json_bytes,json=asJsonBytes,proto3" json:"as_json_bytes,omitempty"`
// If true, serialize this field as Protocol Buffer bytes in the database.
// The field will be stored as bytea and marshaled/unmarshaled using protobuf encoding.
AsProtoBytes bool `protobuf:"varint,3,opt,name=as_proto_bytes,json=asProtoBytes,proto3" json:"as_proto_bytes,omitempty"`
// If true, treat this field as nullable (use pointer type in Go).
// Allows distinguishing between zero values and null/unset values.
Nullable bool `protobuf:"varint,4,opt,name=nullable,proto3" json:"nullable,omitempty"`
// If true, skip this field entirely in code generation.
// The field will not be included in database models or conversion functions.
Skip bool `protobuf:"varint,5,opt,name=skip,proto3" json:"skip,omitempty"`
// If true, embed this field's properties directly into the parent struct.
// Instead of a nested field, the properties are flattened into the parent.
Embed bool `protobuf:"varint,6,opt,name=embed,proto3" json:"embed,omitempty"`
// If true, treat this field as a pgvector type for vector similarity search.
// The field will use the pgvector.Vector type for PostgreSQL vector operations.
PgVector bool `protobuf:"varint,7,opt,name=pg_vector,json=pgVector,proto3" json:"pg_vector,omitempty"`
// If set, this field is populated via a JOIN and is output-only.
Join *Join `protobuf:"bytes,8,opt,name=join,proto3" json:"join,omitempty"`
// contains filtered or unexported fields
}
FieldOpts defines code generation options for individual message fields. Controls serialization format and nullability handling.
func (*FieldOpts) GetAsJsonBytes ¶
func (*FieldOpts) GetAsProtoBytes ¶
func (*FieldOpts) GetColumnName ¶
func (*FieldOpts) GetNullable ¶
func (*FieldOpts) GetPgVector ¶
func (*FieldOpts) ProtoMessage ¶
func (*FieldOpts) ProtoMessage()
func (*FieldOpts) ProtoReflect ¶
func (x *FieldOpts) ProtoReflect() protoreflect.Message
func (*FieldOpts) SetAsJsonBytes ¶
func (*FieldOpts) SetAsProtoBytes ¶
func (*FieldOpts) SetColumnName ¶
func (*FieldOpts) SetNullable ¶
func (*FieldOpts) SetPgVector ¶
type FieldOpts_builder ¶
type FieldOpts_builder struct {
// Override the column name for this field.
ColumnName string
// If true, serialize this field as JSON bytes in the database.
// The field will be stored as JSONB and marshaled/unmarshaled using JSON encoding.
AsJsonBytes bool
// If true, serialize this field as Protocol Buffer bytes in the database.
// The field will be stored as bytea and marshaled/unmarshaled using protobuf encoding.
AsProtoBytes bool
// If true, treat this field as nullable (use pointer type in Go).
// Allows distinguishing between zero values and null/unset values.
Nullable bool
// If true, skip this field entirely in code generation.
// The field will not be included in database models or conversion functions.
Skip bool
// If true, embed this field's properties directly into the parent struct.
// Instead of a nested field, the properties are flattened into the parent.
Embed bool
// If true, treat this field as a pgvector type for vector similarity search.
// The field will use the pgvector.Vector type for PostgreSQL vector operations.
PgVector bool
// If set, this field is populated via a JOIN and is output-only.
Join *Join
// contains filtered or unexported fields
}
func (FieldOpts_builder) Build ¶
func (b0 FieldOpts_builder) Build() *FieldOpts
type Join ¶
type Join struct {
// Required. The resource type joined against. Whether it is an ancestor
// (the containing row) or a descendant (correlated child rows) is deduced
// from the resource name patterns.
ResourceType string `protobuf:"bytes,1,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
// Required. The field name on the joined message to populate from. The
// special value "name" selects the joined resource's name, reconstructed
// from its identifier columns.
Field string `protobuf:"bytes,2,opt,name=field,proto3" json:"field,omitempty"`
// Selects the joined row. When unset, resource_type must be an ancestor of
// this resource: the join equates the ancestor's identifier columns with
// this resource's corresponding columns.
//
// Types that are valid to be assigned to Selector:
//
// *Join_Reference
// *Join_Query
Selector isJoin_Selector `protobuf_oneof:"selector"`
// contains filtered or unexported fields
}
Configures a field that is populated via a JOIN.
func (*Join) ClearQuery ¶
func (x *Join) ClearQuery()
func (*Join) ClearReference ¶
func (x *Join) ClearReference()
func (*Join) ClearSelector ¶
func (x *Join) ClearSelector()
func (*Join) GetReference ¶
func (*Join) GetResourceType ¶
func (*Join) GetSelector ¶
func (x *Join) GetSelector() isJoin_Selector
func (*Join) HasReference ¶
func (*Join) HasSelector ¶
func (*Join) ProtoMessage ¶
func (*Join) ProtoMessage()
func (*Join) ProtoReflect ¶
func (x *Join) ProtoReflect() protoreflect.Message
func (*Join) SetReference ¶
func (*Join) SetResourceType ¶
func (*Join) WhichSelector ¶
func (x *Join) WhichSelector() case_Join_Selector
type Join_Query ¶
type Join_Query struct {
// Selects at most one row among the descendant rows correlated with this
// resource. Emitted as a LEFT JOIN LATERAL (... LIMIT 1), so joined
// fields must be nullable.
Query *Query `protobuf:"bytes,4,opt,name=query,proto3,oneof"`
}
type Join_Reference ¶
type Join_Reference struct {
// The name of a field on *this* message holding a resource name
// reference (annotated with google.api.resource_reference) of
// resource_type. The join conditions equate the shared identifier
// columns and extract the final identifier from the stored name.
Reference string `protobuf:"bytes,3,opt,name=reference,proto3,oneof"`
}
type Join_builder ¶
type Join_builder struct {
// Required. The resource type joined against. Whether it is an ancestor
// (the containing row) or a descendant (correlated child rows) is deduced
// from the resource name patterns.
ResourceType string
// Required. The field name on the joined message to populate from. The
// special value "name" selects the joined resource's name, reconstructed
// from its identifier columns.
Field string
// Fields of oneof Selector:
// The name of a field on *this* message holding a resource name
// reference (annotated with google.api.resource_reference) of
// resource_type. The join conditions equate the shared identifier
// columns and extract the final identifier from the stored name.
Reference *string
// Selects at most one row among the descendant rows correlated with this
// resource. Emitted as a LEFT JOIN LATERAL (... LIMIT 1), so joined
// fields must be nullable.
Query *Query
// contains filtered or unexported fields
}
func (Join_builder) Build ¶
func (b0 Join_builder) Build() *Join
type ModelOpts ¶
type ModelOpts struct {
// Set a schema. Defaults to 'public'.
SchemaName string `protobuf:"bytes,1,opt,name=schema_name,json=schemaName,proto3" json:"schema_name,omitempty"`
// Override the default table name for this model.
// If not set, uses a default derived from the message name.
TableName string `protobuf:"bytes,2,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"`
// Override the id column name. Cannot be set for singletons as they have no id.
IdColumnName string `protobuf:"bytes,3,opt,name=id_column_name,json=idColumnName,proto3" json:"id_column_name,omitempty"`
// contains filtered or unexported fields
}
ModelOpts defines code generation options for an entire message/model. Controls database mapping and which CRUD functions are generated.
func (*ModelOpts) GetIdColumnName ¶
func (*ModelOpts) GetSchemaName ¶
func (*ModelOpts) GetTableName ¶
func (*ModelOpts) ProtoMessage ¶
func (*ModelOpts) ProtoMessage()
func (*ModelOpts) ProtoReflect ¶
func (x *ModelOpts) ProtoReflect() protoreflect.Message
func (*ModelOpts) SetIdColumnName ¶
func (*ModelOpts) SetSchemaName ¶
func (*ModelOpts) SetTableName ¶
type ModelOpts_builder ¶
type ModelOpts_builder struct {
// Set a schema. Defaults to 'public'.
SchemaName string
// Override the default table name for this model.
// If not set, uses a default derived from the message name.
TableName string
// Override the id column name. Cannot be set for singletons as they have no id.
IdColumnName string
// contains filtered or unexported fields
}
func (ModelOpts_builder) Build ¶
func (b0 ModelOpts_builder) Build() *ModelOpts
type Query ¶
type Query struct {
// Optional AIP-160 filter over the descendant resource, restricted to
// conjunctions of comparisons on scalar stored fields, e.g.
// `state != QUOTE_REVISION_STATE_DISCARDED`. Enum values are unquoted and
// resolved to their numbers at generation time.
Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
// Required AIP-132 order_by picking the winning row, e.g.
// "create_time desc".
OrderBy string `protobuf:"bytes,2,opt,name=order_by,json=orderBy,proto3" json:"order_by,omitempty"`
// contains filtered or unexported fields
}
A query selecting at most one descendant row.
func (*Query) GetOrderBy ¶
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
func (*Query) ProtoReflect ¶
func (x *Query) ProtoReflect() protoreflect.Message
func (*Query) SetOrderBy ¶
type Query_builder ¶
type Query_builder struct {
// Optional AIP-160 filter over the descendant resource, restricted to
// conjunctions of comparisons on scalar stored fields, e.g.
// `state != QUOTE_REVISION_STATE_DISCARDED`. Enum values are unquoted and
// resolved to their numbers at generation time.
Filter string
// Required AIP-132 order_by picking the winning row, e.g.
// "create_time desc".
OrderBy string
// contains filtered or unexported fields
}
func (Query_builder) Build ¶
func (b0 Query_builder) Build() *Query