Skip to content

Commit

Permalink
Added NamedWrite to replace NamedWriteRemap (although NamedInsert and…
Browse files Browse the repository at this point in the history
… NamedDelete also exist).
  • Loading branch information
EpsilonPrime committed Dec 3, 2024
1 parent ef02724 commit b98a26d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plan/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ type Builder interface {
// Deprecated: Use NamedScan(...).ChangeMapping() instead.
NamedScanRemap(tableName []string, schema types.NamedStruct, remap []int32) (*NamedTableReadRel, error)
NamedScan(tableName []string, schema types.NamedStruct) *NamedTableReadRel
// Deprecated: Use NamedWriteMap(...).ChangeMapping() instead.
// Deprecated: Use NamedWrite(...).ChangeMapping() instead.
NamedWriteRemap(input Rel, op WriteOp, tableName []string, schema types.NamedStruct, remap []int32) (*NamedTableWriteRel, error)
// NamedInsert inserts data from the input relation into a named table.
NamedInsert(input Rel, tableName []string, schema types.NamedStruct) (*NamedTableWriteRel, error)
Expand Down Expand Up @@ -501,12 +501,16 @@ func (b *builder) NamedWriteRemap(input Rel, op WriteOp, tableName []string, sch
}, nil
}

func (b *builder) NamedWrite(input Rel, op WriteOp, tableName []string, schema types.NamedStruct) (*NamedTableWriteRel, error) {
return b.NamedWriteRemap(input, op, tableName, schema, nil)
}

func (b *builder) NamedInsert(input Rel, tableName []string, schema types.NamedStruct) (*NamedTableWriteRel, error) {
return b.NamedWriteRemap(input, WriteOpInsert, tableName, schema, nil)
return b.NamedWrite(input, WriteOpInsert, tableName, schema)
}

func (b *builder) NamedDelete(input Rel, tableName []string, schema types.NamedStruct) (*NamedTableWriteRel, error) {
return b.NamedWriteRemap(input, WriteOpDelete, tableName, schema, nil)
return b.NamedWrite(input, WriteOpDelete, tableName, schema)
}

func (b *builder) NamedScanRemap(tableName []string, schema types.NamedStruct, remap []int32) (*NamedTableReadRel, error) {
Expand Down

0 comments on commit b98a26d

Please sign in to comment.