glite/error

Errors returned by glite.

Types

The kind of constraint that failed.

pub type ConstraintKind {
  Unique
  PrimaryKey
  ForeignKey
  Check
  NotNull
  OtherConstraint
}

Constructors

  • Unique
  • PrimaryKey
  • ForeignKey
  • Check
  • NotNull
  • OtherConstraint

Everything that can go wrong in a glite call.

pub type Error {
  Constraint(kind: ConstraintKind, message: String)
  Busy(message: String)
  Timeout(after_ms: Int)
  Sqlite(
    code: Int,
    extended_code: Int,
    message: String,
    offset: Int,
  )
  InvalidSql(message: String)
  Encode(message: String)
  Decode(message: String, row: Int, column: Int)
  RowLimitExceeded(limit: Int)
  BatchLimitExceeded(limit: Int)
  Overloaded(queue_limit: Int)
  PragmaMismatch(pragma: String, wanted: String, got: String)
  InvalidConfig(message: String)
  Backup(message: String)
  ConnectionClosed
}

Constructors

  • Constraint(kind: ConstraintKind, message: String)

    A constraint stopped the statement.

  • Busy(message: String)

    The database stayed locked by another connection for longer than the configured busy timeout.

  • Timeout(after_ms: Int)

    The call took longer than the configured call timeout. The running statement was interrupted and nothing it did was committed.

  • Sqlite(
      code: Int,
      extended_code: Int,
      message: String,
      offset: Int,
    )

    Any other SQLite error. code is the primary result code, extended_code the extended one, and offset the byte offset in the SQL the error points at, or -1.

  • InvalidSql(message: String)

    The SQL is empty, or holds more than one statement. Use exec_script to run several statements.

  • Encode(message: String)

    The parameters don’t fit the statement: the wrong number of them, or an integer outside SQLite’s 64-bit range.

  • Decode(message: String, row: Int, column: Int)

    A row didn’t match its decoder. row and column count from 0.

  • RowLimitExceeded(limit: Int)

    A query returned more rows than the configured max_rows. No rows are returned: a result is never silently cut short.

  • BatchLimitExceeded(limit: Int)

    An exec_many call had more parameter sets than the configured max_batch.

  • Overloaded(queue_limit: Int)

    The connection already had the configured max_queue calls waiting.

  • PragmaMismatch(pragma: String, wanted: String, got: String)

    A setting applied when opening the database didn’t take effect: SQLite reported got after glite asked for wanted.

  • InvalidConfig(message: String)

    The configuration is not valid.

  • Backup(message: String)

    A backup could not be made or did not pass its integrity check.

  • ConnectionClosed

    The connection is closed, or its actor has stopped.

Values

pub fn describe(error: Error) -> String

A one-line description of an error, for logs.

✨ Search Document