errors.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package sqlchemy
  15. import (
  16. "yunion.io/x/pkg/errors"
  17. )
  18. const (
  19. // ErrNoDataToUpdate is an Error constant: no data to update
  20. ErrNoDataToUpdate = errors.Error("No data to update")
  21. // ErrDuplicateEntry is an Error constant: duplicate entry
  22. ErrDuplicateEntry = errors.Error("duplicate entry")
  23. // ErrEmptyQuery is an Error constant: empty query
  24. ErrEmptyQuery = errors.Error("empty query")
  25. // ErrEmptyPrimaryKey is an Error constant: no primary key
  26. ErrEmptyPrimaryKey = errors.Error("empty primary keys")
  27. // ErrUnexpectRowCount is an Error constant: the number of rows impacted by modification unexpected
  28. ErrUnexpectRowCount = errors.Error("unexpected row count")
  29. // ErrNeedsPointer is an Error constant: input should be a pointer
  30. ErrNeedsPointer = errors.Error("input needs pointer input")
  31. // ErrNeedsArray is an Error constant: input should be an Array or Slice
  32. ErrNeedsArray = errors.Error("input needs slice or array")
  33. // ErrReadOnly is an Error constant: database is read-only
  34. ErrReadOnly = errors.Error("read only input")
  35. // ErrNotSupported is an Error constant: method not supported yet
  36. ErrNotSupported = errors.ErrNotSupported
  37. // ErrTableNotExists is an Error constant: table not exists
  38. ErrTableNotExists = errors.Error("TableNotExists")
  39. // ErrUnionFieldsNotMatch is an Error constant: fields of union queries not match
  40. ErrUnionFieldsNotMatch = errors.Error("cannot union, name of fields not match")
  41. // ErrUnionDatabasesNotMatch is an Error constant: backend database of union queries not match
  42. ErrUnionAcrossDatabases = errors.Error("cannot union across different databases")
  43. )