-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Non-unique secondary index (no querying) (#1450)
Resolves #297 ## Description This change introduces first functionality for secondary indexes which includes: - specifying index for a collection as part of the collection schema and parsing it - mocks for interfaces the index functionality depends on - db methods to create, delete and retrieve indexes - storing index data in the system storage - storing indexed fields' values to data storage - change to the testing framework to allow testing of indexes This change doesn't include using indexes for fetching data for queries to keep the PR smaller.
- Loading branch information
1 parent
ff81968
commit be619fd
Showing
44 changed files
with
8,456 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,5 +62,6 @@ comment: | |
|
||
ignore: | ||
- "tests" | ||
- "**/mocks/*" | ||
- "**/*_test.go" | ||
- "**/*.pb.go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright 2023 Democratized Data Foundation | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package client | ||
|
||
// IndexDirection is the direction of an index. | ||
type IndexDirection string | ||
|
||
const ( | ||
// Ascending is the value to use for an ascending fields | ||
Ascending IndexDirection = "ASC" | ||
// Descending is the value to use for an descending fields | ||
Descending IndexDirection = "DESC" | ||
) | ||
|
||
// IndexFieldDescription describes how a field is being indexed. | ||
type IndexedFieldDescription struct { | ||
// Name contains the name of the field. | ||
Name string | ||
// Direction contains the direction of the index. | ||
Direction IndexDirection | ||
} | ||
|
||
// IndexDescription describes an index. | ||
type IndexDescription struct { | ||
// Name contains the name of the index. | ||
Name string | ||
// ID is the local identifier of this index. | ||
ID uint32 | ||
// Fields contains the fields that are being indexed. | ||
Fields []IndexedFieldDescription | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.