# Enumerations

The following enumerations are available globally.

### CSErrorCode

- `CSErrorCode`

  The `NSError` error codes for `CSError.Domain`.

  See also

  `CSError`

  See also

  `CoreStoreError`
  See more

  #### Declaration

  Swift

      @objc
      public enum CSErrorCode : Int

### CoreStoreError

- `CoreStoreError`

  All errors thrown from CoreStore are expressed in `CoreStoreError` enum values.

  See more

  #### Declaration

  Swift

      public enum CoreStoreError : Error, CustomNSError, Hashable

### MigrationResult

- `MigrationResult`

  The `MigrationResult` indicates the result of a migration. The `MigrationResult` can be treated as a boolean:

      CoreStore.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in
          switch result {
          case .success(let migrationSteps):
              // ...
          case .failure(let error):
              // ...
          }
      }

  See more

  #### Declaration

  Swift

      public enum MigrationResult : Hashable

### MigrationType

- `MigrationType`

  The `MigrationType` specifies the type of migration required for a store.

  See more

  #### Declaration

  Swift

      public enum MigrationType : Hashable

### CSLocalStorageOptions

- `CSLocalStorageOptions`

  The `CSLocalStorageOptions` provides settings that tells the `CSDataStack` how to setup the persistent store for `CSLocalStorage` implementers.

  See also

  `LocalStorageOptions`
  See more

  #### Declaration

  Swift

      @objc
      public enum CSLocalStorageOptions : Int

### SelectTerm

- `SelectTerm`

  The `SelectTerm` is passed to the `Select` clause to indicate the attributes/aggregate keys to be queried.

  See more

  #### Declaration

  Swift

      public enum SelectTerm<D> : ExpressibleByStringLiteral, Hashable where D : DynamicObject

### SetupResult

- `SetupResult`

  The `SetupResult` indicates the result of an asynchronous initialization of a persistent store. The `SetupResult` can be treated as a boolean:

      try! CoreStore.addStorage(
          SQLiteStore(),
          completion: { (result: SetupResult) -> Void in
              if result {
                  // succeeded
              }
              else {
                  // failed
              }
          }
      )

  or as an `enum`, where the resulting associated object can also be inspected:

      try! CoreStore.addStorage(
          SQLiteStore(),
          completion: { (result: SetupResult) -> Void in
              switch result {
              case .success(let storage):
                  // storage is the related StorageInterface instance
              case .failure(let error):
                  // error is the CoreStoreError enum value for the failure
              }
          }
      )

  See more

  #### Declaration

  Swift

      public enum SetupResult<T> : Hashable where T : StorageInterface

### CoreStore

- `CoreStore`

  `CoreStore` is the main entry point for all other APIs.

  See more

  #### Declaration

  Swift

      public enum CoreStore

### CoreStoreErrorCode

- `CoreStoreErrorCode`

  The `NSError` error codes for `CoreStoreErrorDomain`.

  See more

  #### Declaration

  Swift

      public enum CoreStoreErrorCode : Int

### LogLevel

- `LogLevel`

  The `LogLevel` indicates the severity of a log message.

  #### Declaration

  Swift

      public enum LogLevel

### ValueContainer

- `ValueContainer`

  The containing type for value properties. Use the `DynamicObject.Value` typealias instead for shorter syntax.

      class Animal: CoreStoreObject {
          let species = Value.Required<String>("species", initial: "")
          let nickname = Value.Optional<String>("nickname")
          let color = Transformable.Optional<UIColor>("color")
      }

  See more

  #### Declaration

  Swift

      public enum ValueContainer<O> where O : CoreStoreObject

### TransformableContainer

- `TransformableContainer`

  The containing type for transformable properties. Use the `DynamicObject.Transformable` typealias instead for shorter syntax.

      class Animal: CoreStoreObject {
          let species = Value.Required<String>("species", initial: "")
          let nickname = Value.Optional<String>("nickname")
          let color = Transformable.Optional<UIColor>("color")
      }

  See more

  #### Declaration

  Swift

      public enum TransformableContainer<O> where O : CoreStoreObject

### RelationshipContainer

- `RelationshipContainer`

  The containing type for relationships. Use the `DynamicObject.Relationship` typealias instead for shorter syntax.

      class Dog: CoreStoreObject {
          let master = Relationship.ToOne<Person>("master")
      }
      class Person: CoreStoreObject {
          let pets = Relationship.ToManyUnordered<Dog>("pets", inverse: { $0.master })
      }

  See more

  #### Declaration

  Swift

      public enum RelationshipContainer<O> where O : CoreStoreObject