Documentation ¶
Index ¶
- type Adder
- type Executor
- func (e *Executor[M]) ApplyStmt(ctx context.Context, s internal.StmtBuilder[M]) internal.StmtBuilder[M]
- func (e *Executor[M]) Commit(ctx context.Context) error
- func (e *Executor[M]) CountTo(ctx context.Context, x *int64) error
- func (e *Executor[M]) FindOne(ctx context.Context) (*M, error)
- func (e *Executor[M]) Frag(ctx context.Context) iter.Seq2[string, []any]
- func (e *Executor[M]) From(src sqlpipe.Source[M]) SourceExecutor[M]
- func (e *Executor[M]) IsNil() bool
- func (e *Executor[M]) Item(ctx context.Context) iter.Seq2[*M, error]
- func (e *Executor[M]) List(ctx context.Context) ([]*M, error)
- func (e *Executor[M]) ListTo(ctx context.Context, listAdder Adder[M]) error
- func (e *Executor[M]) Pipe(operators ...sqlpipe.SourceOperator[M]) sqlpipe.Source[M]
- func (e Executor[M]) PipeE(operators ...sqlpipe.SourceOperator[M]) SourceExecutor[M]
- func (e *Executor[M]) Range(ctx context.Context, fn func(m *M)) error
- func (e *Executor[M]) Tx(ctx context.Context, do func(ctx context.Context) error) error
- type OneToMulti
- func (m OneToMulti[ID, Record]) AllRecords() iter.Seq[*Record]
- func (m OneToMulti[ID, Record]) FillWith(id ID, do func(p *Record))
- func (m OneToMulti[ID, Record]) IsZero() bool
- func (m OneToMulti[ID, Record]) Keys() []ID
- func (m OneToMulti[ID, Record]) Record(id ID, r *Record)
- func (m OneToMulti[ID, Record]) Records(id ID) iter.Seq[*Record]
- type OneToOne
- func (m OneToOne[ID, Record]) AllRecords() iter.Seq[*Record]
- func (m OneToOne[ID, Record]) FillWith(id ID, do func(p *Record))
- func (m OneToOne[ID, Record]) IsZero() bool
- func (m OneToOne[ID, Record]) Keys() []ID
- func (m OneToOne[ID, Record]) Record(id ID, r *Record)
- func (m OneToOne[ID, Record]) Records(id ID) iter.Seq[*Record]
- type RelCache
- type SourceExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
func (*Executor[M]) ApplyStmt ¶
func (e *Executor[M]) ApplyStmt(ctx context.Context, s internal.StmtBuilder[M]) internal.StmtBuilder[M]
func (*Executor[M]) Pipe ¶
func (e *Executor[M]) Pipe(operators ...sqlpipe.SourceOperator[M]) sqlpipe.Source[M]
func (Executor[M]) PipeE ¶
func (e Executor[M]) PipeE(operators ...sqlpipe.SourceOperator[M]) SourceExecutor[M]
type OneToMulti ¶
type OneToMulti[ID comparable, Record any] map[ID][]*Record
func (OneToMulti[ID, Record]) AllRecords ¶
func (m OneToMulti[ID, Record]) AllRecords() iter.Seq[*Record]
func (OneToMulti[ID, Record]) FillWith ¶
func (m OneToMulti[ID, Record]) FillWith(id ID, do func(p *Record))
Depecrated use Records instead
func (OneToMulti[ID, Record]) IsZero ¶
func (m OneToMulti[ID, Record]) IsZero() bool
func (OneToMulti[ID, Record]) Keys ¶
func (m OneToMulti[ID, Record]) Keys() []ID
func (OneToMulti[ID, Record]) Record ¶
func (m OneToMulti[ID, Record]) Record(id ID, r *Record)
func (OneToMulti[ID, Record]) Records ¶
func (m OneToMulti[ID, Record]) Records(id ID) iter.Seq[*Record]
type OneToOne ¶
type OneToOne[ID comparable, Record any] map[ID]*Record
func (OneToOne[ID, Record]) AllRecords ¶
type SourceExecutor ¶
type SourceExecutor[M sqlpipe.Model] interface { sqlpipe.Source[M] From(source sqlpipe.Source[M]) SourceExecutor[M] PipeE(operators ...sqlpipe.SourceOperator[M]) SourceExecutor[M] // just execute Commit(ctx context.Context) error // execute then iter item Item(ctx context.Context) iter.Seq2[*M, error] // execute then range Range(ctx context.Context, fn func(*M)) error // execute then scan as one item FindOne(ctx context.Context) (*M, error) // execute then list as item list List(ctx context.Context) ([]*M, error) // execute then list to item adder ListTo(ctx context.Context, adder Adder[M]) error // execute as count CountTo(ctx context.Context, x *int64) error }
func FromSource ¶
func FromSource[M sqlpipe.Model](src sqlpipe.Source[M]) SourceExecutor[M]
Click to show internal directories.
Click to hide internal directories.