forked from sourcenetwork/defradb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Remove CollectionDescription.Schema (sourcenetwork#1965)
## Relevant issue(s) Resolves sourcenetwork#1958 ## Description Removes CollectionDescription.Schema. Also splits the storage of schema out from within collection. The storage of schema has been broken out to a new sub-package of db, at the moment it is a very simple file, but collection will be moved there in sourcenetwork#1964. I was planning on doing that in this PR (in part, to provide context for reviewers, as atm it is basically a single-file package), but it proved to be non-trivial due to some existing messiness in that space and was broken out to two more tasks. I also wish for stuff in that directory to eventually follow a repository-like pattern, where stuff is cached (within a context/txn's context) instead of fetching from store on each call. Moving this stuff out to a new directory instead of preserving it in the (already very large) db directory should make both db and the new sub-package a fair bit more cohesive and easier to read.
- Loading branch information
1 parent
7e5f33d
commit e95510f
Showing
10 changed files
with
287 additions
and
309 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
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,30 @@ | ||
// 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 description | ||
|
||
import "github.com/sourcenetwork/defradb/errors" | ||
|
||
const ( | ||
errFailedToCreateSchemaQuery string = "failed to create schema prefix query" | ||
errFailedToCloseSchemaQuery string = "failed to close schema prefix query" | ||
) | ||
|
||
// NewErrFailedToCreateSchemaQuery returns a new error indicating that the query | ||
// to create a schema failed. | ||
func NewErrFailedToCreateSchemaQuery(inner error) error { | ||
return errors.Wrap(errFailedToCreateSchemaQuery, inner) | ||
} | ||
|
||
// NewErrFailedToCreateSchemaQuery returns a new error indicating that the query | ||
// to create a schema failed to close. | ||
func NewErrFailedToCloseSchemaQuery(inner error) error { | ||
return errors.Wrap(errFailedToCloseSchemaQuery, inner) | ||
} |
Oops, something went wrong.