Skip to content

Commit

Permalink
doc: fictive bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrot-lc committed Oct 22, 2024
1 parent aa52606 commit 56ac426
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/db_generator.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ pub fn print_db(conn: Connection) {
/// Generate a temporary in-memory bookmarks database. The database is
/// initialized with the given list of bookmarks.
///
/// # Examples
///
/// ```gleam
/// let bookmarks = [
/// Bookmark("www.google.fr", "Google desc"),
/// Bookmark("www.gleam.run", "Gleam!"),
/// ]
/// use conn <- db_generator.fictive_bookmarks(bookmarks)
/// ```
///
pub fn fictive_bookmarks(bookmarks: List(Bookmark), f: fn(Connection) -> a) -> a {
use conn <- sqlight.with_connection(":memory:")

Expand Down

0 comments on commit 56ac426

Please sign in to comment.