Skip to content

Commit 7b0aef8

Browse files
committed
FAB-1257 Removal of Table API
Removed Table API for the following reasons * The v0.5/v0.6 Pseedo-table API does not map well to current or next generation Fabric capabilities * Project teams have been confused and frustrated with table API limitations Encourage all new chaincode to use JSON-based data structures Change-Id: I3f01177e98b2dc40d6a00815ad9000132f9d9591 Signed-off-by: senthil <[email protected]>
1 parent 4a156cc commit 7b0aef8

File tree

11 files changed

+188
-2238
lines changed

11 files changed

+188
-2238
lines changed

bddtests/chaincode/go/table/table.go

-538
This file was deleted.

core/chaincode/shim/chaincode.go

+35-438
Large diffs are not rendered by default.

core/chaincode/shim/interfaces.go

+11-39
Original file line numberDiff line numberDiff line change
@@ -69,45 +69,17 @@ type ChaincodeStubInterface interface {
6969
// returned by the iterator is random.
7070
RangeQueryState(startKey, endKey string) (StateRangeQueryIteratorInterface, error)
7171

72-
// CreateTable creates a new table given the table name and column definitions
73-
CreateTable(name string, columnDefinitions []*ColumnDefinition) error
74-
75-
// GetTable returns the table for the specified table name or ErrTableNotFound
76-
// if the table does not exist.
77-
GetTable(tableName string) (*Table, error)
78-
79-
// DeleteTable deletes an entire table and all associated rows.
80-
DeleteTable(tableName string) error
81-
82-
// InsertRow inserts a new row into the specified table.
83-
// Returns -
84-
// true and no error if the row is successfully inserted.
85-
// false and no error if a row already exists for the given key.
86-
// false and a TableNotFoundError if the specified table name does not exist.
87-
// false and an error if there is an unexpected error condition.
88-
InsertRow(tableName string, row Row) (bool, error)
89-
90-
// ReplaceRow updates the row in the specified table.
91-
// Returns -
92-
// true and no error if the row is successfully updated.
93-
// false and no error if a row does not exist the given key.
94-
// flase and a TableNotFoundError if the specified table name does not exist.
95-
// false and an error if there is an unexpected error condition.
96-
ReplaceRow(tableName string, row Row) (bool, error)
97-
98-
// GetRow fetches a row from the specified table for the given key.
99-
GetRow(tableName string, key []Column) (Row, error)
100-
101-
// GetRows returns multiple rows based on a partial key. For example, given table
102-
// | A | B | C | D |
103-
// where A, C and D are keys, GetRows can be called with [A, C] to return
104-
// all rows that have A, C and any value for D as their key. GetRows could
105-
// also be called with A only to return all rows that have A and any value
106-
// for C and D as their key.
107-
GetRows(tableName string, key []Column) (<-chan Row, error)
108-
109-
// DeleteRow deletes the row for the given key from the specified table.
110-
DeleteRow(tableName string, key []Column) error
72+
//PartialCompositeKeyQuery function can be invoked by a chaincode to query the
73+
//state based on a given partial composite key. This function returns an
74+
//iterator which can be used to iterate over all composite keys whose prefix
75+
//matches the given partial composite key. This function should be used only for
76+
//a partial composite key. For a full composite key, an iter with empty response
77+
//would be returned.
78+
PartialCompositeKeyQuery(objectType string, keys []string) (StateRangeQueryIteratorInterface, error)
79+
80+
//Given a list of attributes, createCompundKey function combines these attributes
81+
//to form a composite key.
82+
CreateCompositeKey(objectType string, attributes []string) (string, error)
11183

11284
// GetCallerCertificate returns caller certificate
11385
GetCallerCertificate() ([]byte, error)

core/chaincode/shim/java/build.gradle

-5
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,6 @@ task copyProtos(type:Copy){
9494
include '**/chaincodeevent.proto'
9595
include '**/chaincode.proto'
9696
}
97-
from ("../") {
98-
duplicatesStrategy.EXCLUDE
99-
include '**/table.proto'
100-
exclude 'java'
101-
}
10297
into "${projectDir}/src/main/proto/peer"
10398

10499
}

0 commit comments

Comments
 (0)