package sihl

  1. Overview
  2. Docs
The modular functional web framework

Install

Dune Dependency

Authors

Maintainers

Sources

sihl-0.1.3.tbz
sha256=3d1acdd1eae24a7131033656f90b5d20c1621e6ef92957edf88a09b8b5f2d9e9
sha512=d224f54e20a9465c7a03d534dadcb2b9a181ae87c13731840db945aab37534f6f3982c5cb25a197e90c17d8772da062b19fa92bb93ed53a8b736c3776a7776db

doc/sihl.seed/Seed/index.html

Module SeedSource

A seed is a sequence of service calls that set a system state. Seeds are typically used before integration testing to set the initial state.

Introduction

A seed is a function that takes a Core.Ctx.t and returns unit Lwt.t. It has also a name that identifies it uniquely. This means, that no two seeds are allowed to have the same name.

Seeds can be used to set some system state. This can be useful for integration tests or to add data to a live system in a controlled way.

Many other seeding systems allow for export and import of pure data. Sihl's seeding system is just a function that does several service calls. One major advantage is, that there is no seed data that needs to be migrated and the seeding is statically typed. A disadvantage of this approach is, that seed data generation requires a Sihl app with services.

Sourcetype t

Installation

module Log = Sihl.Log.Service.Make ()
module Cmd = Sihl.Cmd.Service.Make ()
module Seed = Sihl.Seed.Service.Make (Log) (Cmd)
Sourcemodule Service : sig ... end

Usage

Sihl.Seed.Service.Sig.SERVICE

OCaml

Innovation. Community. Security.