From 7cd316fcff8e83e13f8206b3b16f6e7533f0338f Mon Sep 17 00:00:00 2001 From: Pierrot LC Date: Sun, 27 Oct 2024 20:37:51 +0100 Subject: [PATCH] renamed to buku_merger --- README.md | 12 ++++++------ gleam.toml | 2 +- src/{sqlite_merger.gleam => buku_merger.gleam} | 3 ++- ...lite_merger_test.gleam => buku_merger_test.gleam} | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) rename src/{sqlite_merger.gleam => buku_merger.gleam} (94%) rename test/{sqlite_merger_test.gleam => buku_merger_test.gleam} (94%) diff --git a/README.md b/README.md index 77adfb9..95cfd25 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# sqlite_merger +# Buku Merger -[![Package Version](https://img.shields.io/hexpm/v/sqlite_merger)](https://hex.pm/packages/sqlite_merger) -[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/sqlite_merger/) +[![Package Version](https://img.shields.io/hexpm/v/buku_merger)](https://hex.pm/packages/buku_merger) +[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/buku_merger/) ```sh -gleam add sqlite_merger@1 +gleam add buku_merger@1 ``` ```gleam -import sqlite_merger +import buku_merger pub fn main() { // TODO: An example of the project in use } ``` -Further documentation can be found at . +Further documentation can be found at . ## Development diff --git a/gleam.toml b/gleam.toml index 86ffa33..daf826b 100644 --- a/gleam.toml +++ b/gleam.toml @@ -1,4 +1,4 @@ -name = "sqlite_merger" +name = "buku_merger" version = "1.0.0" # Fill out these fields if you intend to generate HTML documentation or publish diff --git a/src/sqlite_merger.gleam b/src/buku_merger.gleam similarity index 94% rename from src/sqlite_merger.gleam rename to src/buku_merger.gleam index 855cb2f..7f841cd 100644 --- a/src/sqlite_merger.gleam +++ b/src/buku_merger.gleam @@ -1,4 +1,5 @@ import gleam/dynamic +import gleam/io import gleam/string import sqlight.{type Connection} @@ -21,7 +22,7 @@ pub fn bookmarks_added( " SELECT t1.id FROM target as t1 WHERE t1.url NOT IN - ( SELECT t2.url FROM source as t2); + ( SELECT t2.url FROM source as t2 ); " |> string.replace(each: "source", with: source) |> string.replace(each: "target", with: target) diff --git a/test/sqlite_merger_test.gleam b/test/buku_merger_test.gleam similarity index 94% rename from test/sqlite_merger_test.gleam rename to test/buku_merger_test.gleam index 3ed1425..9942985 100644 --- a/test/sqlite_merger_test.gleam +++ b/test/buku_merger_test.gleam @@ -1,3 +1,4 @@ +import buku_merger.{type Id} import db_generator.{Bookmark} import gleam/dynamic import gleam/list @@ -5,7 +6,6 @@ import gleam/order import gleeunit import gleeunit/should import sqlight -import sqlite_merger.{type Id} pub fn main() { gleeunit.main() @@ -27,7 +27,7 @@ pub fn added_bookmarks_test() { let _ = db_generator.insert_bookmarks(bookmarks_1, "source", conn) let _ = db_generator.insert_bookmarks(bookmarks_2, "target", conn) - sqlite_merger.bookmarks_added(conn, "source", "target") + buku_merger.bookmarks_added(conn, "source", "target") |> list.sort(fn(a, b) { case a < b { True -> order.Lt