v1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 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

View Source
const Join_Query_case case_Join_Selector = 4
View Source
const Join_Reference_case case_Join_Selector = 3
View Source
const Join_Selector_not_set_case case_Join_Selector = 0

Variables

View Source
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.

View Source
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.

View Source
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) ClearJoin

func (x *FieldOpts) ClearJoin()

func (*FieldOpts) GetAsJsonBytes

func (x *FieldOpts) GetAsJsonBytes() bool

func (*FieldOpts) GetAsProtoBytes

func (x *FieldOpts) GetAsProtoBytes() bool

func (*FieldOpts) GetColumnName

func (x *FieldOpts) GetColumnName() string

func (*FieldOpts) GetEmbed

func (x *FieldOpts) GetEmbed() bool

func (*FieldOpts) GetJoin

func (x *FieldOpts) GetJoin() *Join

func (*FieldOpts) GetNullable

func (x *FieldOpts) GetNullable() bool

func (*FieldOpts) GetPgVector

func (x *FieldOpts) GetPgVector() bool

func (*FieldOpts) GetSkip

func (x *FieldOpts) GetSkip() bool

func (*FieldOpts) HasJoin

func (x *FieldOpts) HasJoin() bool

func (*FieldOpts) ProtoMessage

func (*FieldOpts) ProtoMessage()

func (*FieldOpts) ProtoReflect

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

func (*FieldOpts) Reset

func (x *FieldOpts) Reset()

func (*FieldOpts) SetAsJsonBytes

func (x *FieldOpts) SetAsJsonBytes(v bool)

func (*FieldOpts) SetAsProtoBytes

func (x *FieldOpts) SetAsProtoBytes(v bool)

func (*FieldOpts) SetColumnName

func (x *FieldOpts) SetColumnName(v string)

func (*FieldOpts) SetEmbed

func (x *FieldOpts) SetEmbed(v bool)

func (*FieldOpts) SetJoin

func (x *FieldOpts) SetJoin(v *Join)

func (*FieldOpts) SetNullable

func (x *FieldOpts) SetNullable(v bool)

func (*FieldOpts) SetPgVector

func (x *FieldOpts) SetPgVector(v bool)

func (*FieldOpts) SetSkip

func (x *FieldOpts) SetSkip(v bool)

func (*FieldOpts) String

func (x *FieldOpts) String() string

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) GetField

func (x *Join) GetField() string

func (*Join) GetQuery

func (x *Join) GetQuery() *Query

func (*Join) GetReference

func (x *Join) GetReference() string

func (*Join) GetResourceType

func (x *Join) GetResourceType() string

func (*Join) GetSelector

func (x *Join) GetSelector() isJoin_Selector

func (*Join) HasQuery

func (x *Join) HasQuery() bool

func (*Join) HasReference

func (x *Join) HasReference() bool

func (*Join) HasSelector

func (x *Join) HasSelector() bool

func (*Join) ProtoMessage

func (*Join) ProtoMessage()

func (*Join) ProtoReflect

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

func (*Join) Reset

func (x *Join) Reset()

func (*Join) SetField

func (x *Join) SetField(v string)

func (*Join) SetQuery

func (x *Join) SetQuery(v *Query)

func (*Join) SetReference

func (x *Join) SetReference(v string)

func (*Join) SetResourceType

func (x *Join) SetResourceType(v string)

func (*Join) String

func (x *Join) String() string

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 (x *ModelOpts) GetIdColumnName() string

func (*ModelOpts) GetSchemaName

func (x *ModelOpts) GetSchemaName() string

func (*ModelOpts) GetTableName

func (x *ModelOpts) GetTableName() string

func (*ModelOpts) ProtoMessage

func (*ModelOpts) ProtoMessage()

func (*ModelOpts) ProtoReflect

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

func (*ModelOpts) Reset

func (x *ModelOpts) Reset()

func (*ModelOpts) SetIdColumnName

func (x *ModelOpts) SetIdColumnName(v string)

func (*ModelOpts) SetSchemaName

func (x *ModelOpts) SetSchemaName(v string)

func (*ModelOpts) SetTableName

func (x *ModelOpts) SetTableName(v string)

func (*ModelOpts) String

func (x *ModelOpts) String() string

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) GetFilter

func (x *Query) GetFilter() string

func (*Query) GetOrderBy

func (x *Query) GetOrderBy() string

func (*Query) ProtoMessage

func (*Query) ProtoMessage()

func (*Query) ProtoReflect

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

func (*Query) Reset

func (x *Query) Reset()

func (*Query) SetFilter

func (x *Query) SetFilter(v string)

func (*Query) SetOrderBy

func (x *Query) SetOrderBy(v string)

func (*Query) String

func (x *Query) String() string

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

Jump to

Keyboard shortcuts

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