mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* Database isolation: Balancer
Remove naive Balancer
remove debugging lines
Thread dax.Transaction through Controller
Change role to roleType
Swap out Balancer interface with new one
Standardize InvalidTransaction error
Add some interface comments
* Remove type.Worker; replace with type.Address
* Remove database validate from Queryer
This is already being handled in the `CreateTable()` method. Prior
to doing that validation, we were getting a panic, but that's no longer
the case.
* Remove dax.TableQualifier; replace with dax.QualifiedDatabaseID
* Update IDK test to create database
(cherry picked from commit d971cfc269)
61 lines
1.5 KiB
Go
61 lines
1.5 KiB
Go
package schemar
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/featurebasedb/featurebase/v3/dax"
|
|
"github.com/featurebasedb/featurebase/v3/errors"
|
|
)
|
|
|
|
const (
|
|
ErrCodeDatabaseIDInvalid errors.Code = "DatabaseIDInvalid"
|
|
ErrCodeDatabaseNameInvalid errors.Code = "DatabaseNameInvalid"
|
|
|
|
ErrCodeTableIDInvalid errors.Code = "TableIDInvalid"
|
|
ErrCodeTableNameInvalid errors.Code = "TableNameInvalid"
|
|
ErrCodeInvalidPrimaryKey errors.Code = "InvalidPrimaryKey"
|
|
|
|
ErrCodeFieldNameInvalid errors.Code = "FieldNameInvalid"
|
|
)
|
|
|
|
func NewErrDatabaseIDInvalid(databaseID dax.DatabaseID) error {
|
|
return errors.New(
|
|
ErrCodeDatabaseIDInvalid,
|
|
fmt.Sprintf("database ID '%s' is invalid", databaseID),
|
|
)
|
|
}
|
|
|
|
func NewErrDatabaseNameInvalid(databaseName dax.DatabaseName) error {
|
|
return errors.New(
|
|
ErrCodeDatabaseNameInvalid,
|
|
fmt.Sprintf("database name '%s' is invalid", databaseName),
|
|
)
|
|
}
|
|
|
|
func NewErrTableIDInvalid(tableID dax.TableID) error {
|
|
return errors.New(
|
|
ErrCodeTableIDInvalid,
|
|
fmt.Sprintf("table ID '%s' is invalid", tableID),
|
|
)
|
|
}
|
|
|
|
func NewErrTableNameInvalid(tableName dax.TableName) error {
|
|
return errors.New(
|
|
ErrCodeTableNameInvalid,
|
|
fmt.Sprintf("table name '%s' is invalid", tableName),
|
|
)
|
|
}
|
|
|
|
func NewErrInvalidPrimaryKey() error {
|
|
return errors.New(
|
|
ErrCodeInvalidPrimaryKey,
|
|
"invalid primary key",
|
|
)
|
|
}
|
|
|
|
func NewErrFieldNameInvalid(fieldName dax.FieldName) error {
|
|
return errors.New(
|
|
ErrCodeFieldNameInvalid,
|
|
fmt.Sprintf("field name '%s' is invalid", fieldName),
|
|
)
|
|
}
|