Repository: codenotary/immudb
File: embedded/sql/engine.go (Go)

Code before:
package sql

import (
	"bytes"
	"encoding/binary"
	"errors"
	"io"
	"math"
	"strings"
	"sync"

	"github.com/codenotary/immudb/embedded/store"
	"github.com/codenotary/immudb/embedded/tbtree"
)

var ErrNoSupported = errors.New("not yet supported")
var ErrIllegalArguments = store.ErrIllegalArguments
var ErrDDLorDMLTxOnly = errors.New("transactions can NOT combine DDL and DML statements")
var ErrDatabaseDoesNotExist = errors.New("database does not exist")
var ErrDatabaseAlreadyExists = errors.New("database already exists")
var ErrNoDatabaseSelected = errors.New("no database selected")
var ErrTableAlreadyExists = errors.New("table already exists")
var ErrTableDoesNotExist = errors.New("table does not exist")
var ErrColumnDoesNotExist = errors.New("column does not exist")
var ErrColumnNotIndexed = errors.New("column is not indexed")
var ErrInvalidPK = errors.New("primary key of invalid type. Supported types are: INTEGER, VARCHAR[32], TIMESTAMP OR BLOB[256]")
var ErrLimitedAutoIncrement = errors.New("only INTEGER primary keys can be set as auto incremental")
var ErrNoValueForAutoIncrementalColumn = errors.New("no value should be specified for auto incremental columns")
var ErrDuplicatedColumn = errors.New("duplicated column")
var ErrInvalidColumn = errors.New("invalid column")
var ErrPKCanNotBeNull = errors.New("primary key can not be null")
var ErrNotNullableColumnCannotBeNull = errors.New("not nullable column can not be null")
var ErrIndexedColumnCanNotBeNull = errors.New("indexed column can not be null")
var ErrIndexAlreadyExists = errors.New("index already exists")
var ErrInvalidNumberOfValues = errors.New("invalid number of values provided")
var ErrInvalidValue = errors.New("invalid value provided")
var ErrInferredMultipleTypes = errors.New("inferred multiple types")
var ErrExpectingDQLStmt = errors.New("illegal statement. DQL statement expected")
var ErrLimitedOrderBy = errors.New("order is limit to one indexed column")
var ErrLimitedGroupBy = errors.New("group by requires ordering by the grouping column")
var ErrIllegalMappedKey = errors.New("error illegal mapped key")
var ErrCorruptedData = store.ErrCorruptedData
var ErrCatalogNotReady = errors.New("catalog not ready")
var ErrNoMoreRows = store.ErrNoMoreEntries
var ErrLimitedJoins = errors.New("joins limited to tables")
var ErrInvalidTypes = errors.New("invalid types")
var ErrUnsupportedJoinType = errors.New("unsupported join type")
var ErrInvalidCondition = errors.New("invalid condition")
var ErrHavingClauseRequiresGroupClause = errors.New("having clause requires group clause")
var ErrNotComparableValues = errors.New("values are not comparable")
var ErrUnexpected = errors.New("unexpected error")

Review comment (suggestion):
```suggestion
var ErrInvalidPK = errors.New("primary key of invalid type. Supported types are: INTEGER, VARCHAR[32], TIMESTAMP OR BLOB[32]")
```

Code after:
package sql

import (
	"bytes"
	"encoding/binary"
	"errors"
	"io"
	"math"
	"strings"
	"sync"

	"github.com/codenotary/immudb/embedded/store"
	"github.com/codenotary/immudb/embedded/tbtree"
)

var ErrNoSupported = errors.New("not yet supported")
var ErrIllegalArguments = store.ErrIllegalArguments
var ErrDDLorDMLTxOnly = errors.New("transactions can NOT combine DDL and DML statements")
var ErrDatabaseDoesNotExist = errors.New("database does not exist")
var ErrDatabaseAlreadyExists = errors.New("database already exists")
var ErrNoDatabaseSelected = errors.New("no database selected")
var ErrTableAlreadyExists = errors.New("table already exists")
var ErrTableDoesNotExist = errors.New("table does not exist")
var ErrColumnDoesNotExist = errors.New("column does not exist")
var ErrColumnNotIndexed = errors.New("column is not indexed")
var ErrInvalidPK = errors.New("primary key of invalid type. Supported types are: INTEGER, VARCHAR[32], TIMESTAMP OR BLOB[32]")
var ErrLimitedAutoIncrement = errors.New("only INTEGER primary keys can be set as auto incremental")
var ErrNoValueForAutoIncrementalColumn = errors.New("no value should be specified for auto incremental columns")
var ErrDuplicatedColumn = errors.New("duplicated column")
var ErrInvalidColumn = errors.New("invalid column")
var ErrPKCanNotBeNull = errors.New("primary key can not be null")
var ErrNotNullableColumnCannotBeNull = errors.New("not nullable column can not be null")
var ErrIndexedColumnCanNotBeNull = errors.New("indexed column can not be null")
var ErrIndexAlreadyExists = errors.New("index already exists")
var ErrInvalidNumberOfValues = errors.New("invalid number of values provided")
var ErrInvalidValue = errors.New("invalid value provided")
var ErrInferredMultipleTypes = errors.New("inferred multiple types")
var ErrExpectingDQLStmt = errors.New("illegal statement. DQL statement expected")
var ErrLimitedOrderBy = errors.New("order is limit to one indexed column")
var ErrLimitedGroupBy = errors.New("group by requires ordering by the grouping column")
var ErrIllegalMappedKey = errors.New("error illegal mapped key")
var ErrCorruptedData = store.ErrCorruptedData
var ErrCatalogNotReady = errors.New("catalog not ready")
var ErrNoMoreRows = store.ErrNoMoreEntries
var ErrLimitedJoins = errors.New("joins limited to tables")
var ErrInvalidTypes = errors.New("invalid types")
var ErrUnsupportedJoinType = errors.New("unsupported join type")
var ErrInvalidCondition = errors.New("invalid condition")
var ErrHavingClauseRequiresGroupClause = errors.New("having clause requires group clause")
var ErrNotComparableValues = errors.New("values are not comparable")
var ErrUnexpected = errors.New("unexpected error")