MCPcopy Create free account
hub / github.com/apecloud/myduckserver / getPrimaryKeyIndices

Function getPrimaryKeyIndices

delta/controller.go:616–625  ·  view source on GitHub ↗

Helper function to get the primary key indices.

(appender *DeltaAppender)

Source from the content-addressed store, hash-verified

614
615// Helper function to get the primary key indices.
616func getPrimaryKeyIndices(appender *DeltaAppender) []int {
617 schema := appender.BaseSchema()
618 indices := make([]int, 0, 1)
619 for i, col := range schema {
620 if col.PrimaryKey {
621 indices = append(indices, i+appender.NumAugmentedFields())
622 }
623 }
624 return indices
625}
626
627// Helper function to get the primary key. For composite primary keys, `row()` is used.
628func getPrimaryKeyStruct(schema sql.Schema) string {

Callers 1

handleDeleteOnlyMethod · 0.70

Calls 2

BaseSchemaMethod · 0.80
NumAugmentedFieldsMethod · 0.80

Tested by

no test coverage detected