postglide

Types

pub type Blob
pub type Config {
  Config(
    file_system: FileSystem,
    debug_level: Int,
    relaxed_durability: Bool,
    username: option.Option(String),
  )
}

Constructors

  • Config(
      file_system: FileSystem,
      debug_level: Int,
      relaxed_durability: Bool,
      username: option.Option(String),
    )
pub type Connection
pub type FileSystem {
  Memory
  NodeFS(path: String)
  IndexedDB(database: String)
  OriginPrivateFS(path: String)
}

Constructors

  • Memory
  • NodeFS(path: String)
  • IndexedDB(database: String)
  • OriginPrivateFS(path: String)
pub type PGResult
pub type QueryError {
  DatabaseError(message: String)
  DecodeFailed(List(dynamic.DecodeError))
}

Constructors

  • DatabaseError(message: String)
  • DecodeFailed(List(dynamic.DecodeError))
pub type Results(t) {
  Results(affected_rows: Int, rows: List(t), blob: Option(Blob))
}

Constructors

  • Results(affected_rows: Int, rows: List(t), blob: Option(Blob))
pub type Value

Functions

pub fn bool(bool: Bool) -> Value
pub fn create(with config: Config) -> Promise(Connection)
pub fn default_config() -> Config
pub fn exec(
  connection: Connection,
  query: String,
) -> Promise(List(PGResult))
pub fn int(int: Int) -> Value
pub fn query(
  query: String,
  connection: Connection,
  arguments: List(Value),
  expecting decoder: fn(Dynamic) -> Result(a, List(DecodeError)),
) -> Promise(Result(Results(a), QueryError))
pub fn string(string: String) -> Value
Search Document