+1
-1
examples/utilities/tiny_database/gleam.toml
+1
-1
examples/utilities/tiny_database/gleam.toml
+8
-7
examples/utilities/tiny_database/manifest.toml
+8
-7
examples/utilities/tiny_database/manifest.toml
···
2
2
# You typically do not need to edit this file
3
3
4
4
packages = [
5
-
{ name = "gleam_erlang", version = "0.23.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "C21CFB816C114784E669FFF4BBF433535EEA9960FA2F216209B8691E87156B96" },
5
+
{ name = "filepath", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "EFB6FF65C98B2A16378ABC3EE2B14124168C0CE5201553DE652E2644DCFDB594" },
6
+
{ name = "gleam_crypto", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_crypto", source = "hex", outer_checksum = "ADD058DEDE8F0341F1ADE3AAC492A224F15700829D9A3A3F9ADF370F875C51B7" },
7
+
{ name = "gleam_erlang", version = "0.25.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "054D571A7092D2A9727B3E5D183B7507DAB0DA41556EC9133606F09C15497373" },
6
8
{ name = "gleam_json", version = "0.7.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "CB405BD93A8828BCD870463DE29375E7B2D252D9D124C109E5B618AAC00B86FC" },
7
-
{ name = "gleam_otp", version = "0.8.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_erlang"], otp_app = "gleam_otp", source = "hex", outer_checksum = "18EF8242A5E54BA92F717C7222F03B3228AEE00D1F286D4C56C3E8C18AA2588E" },
8
-
{ name = "gleam_stdlib", version = "0.32.1", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "ABF00CDCCB66FABBCE351A50060964C4ACE798F95A0D78622C8A7DC838792577" },
9
-
{ name = "gleeunit", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "D3682ED8C5F9CAE1C928F2506DE91625588CC752495988CBE0F5653A42A6F334" },
10
-
{ name = "ids", version = "0.11.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_stdlib", "gleam_otp"], otp_app = "ids", source = "hex", outer_checksum = "912A21722E07E68117B92863D05B15BE97E5AEF4ECF47C2F567CECCD5A4F5739" },
11
-
{ name = "simplifile", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "0BD6F0E7DA1A7E11D18B8AD48453225CAFCA4C8CFB4513D217B372D2866C501C" },
9
+
{ name = "gleam_stdlib", version = "0.38.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "663CF11861179AF415A625307447775C09404E752FF99A24E2057C835319F1BE" },
10
+
{ name = "gleeunit", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "72CDC3D3F719478F26C4E2C5FED3E657AC81EC14A47D2D2DEBB8693CA3220C3B" },
11
+
{ name = "simplifile", version = "1.7.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "1D5DFA3A2F9319EC85825F6ED88B8E449F381B0D55A62F5E61424E748E7DDEB0" },
12
12
{ name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" },
13
+
{ name = "youid", version = "1.1.0", build_tools = ["gleam"], requirements = ["gleam_crypto", "gleam_erlang", "gleam_stdlib"], otp_app = "youid", source = "hex", outer_checksum = "15BF3E8173C8741930E23D22071CD55AE203B6E43B9E0C6C9E7D9F116808E418" },
13
14
]
14
15
15
16
[requirements]
16
17
gleam_json = { version = "~> 0.6" }
17
18
gleam_stdlib = { version = "~> 0.30" }
18
19
gleeunit = { version = "~> 1.0" }
19
-
ids = { version = "~> 0.8" }
20
20
simplifile = { version = "~> 1.0" }
21
+
youid = { version = ">= 1.1.0 and < 2.0.0"}
+2
-2
examples/utilities/tiny_database/src/tiny_database.gleam
+2
-2
examples/utilities/tiny_database/src/tiny_database.gleam
···
3
3
import gleam/json
4
4
import gleam/list
5
5
import gleam/result
6
-
import ids/nanoid
7
6
import simplifile
7
+
import youid/uuid
8
8
9
9
pub opaque type Connection {
10
10
Connection(root: String)
···
44
44
values: Dict(String, String),
45
45
) -> Result(String, Nil) {
46
46
let assert Ok(_) = simplifile.create_directory_all(connection.root)
47
-
let id = nanoid.generate()
47
+
let id = uuid.v4_string()
48
48
let values =
49
49
values
50
50
|> dict.to_list
+2
-2
examples/utilities/tiny_database/test/tiny_database_test.gleam
+2
-2
examples/utilities/tiny_database/test/tiny_database_test.gleam
···
1
-
import gleam/map
1
+
import gleam/dict
2
2
import gleeunit
3
3
import gleeunit/should
4
4
import tiny_database
···
10
10
pub fn insert_read_test() {
11
11
let connection = tiny_database.connect("tmp/data")
12
12
13
-
let data = map.from_list([#("name", "Alice"), #("profession", "Programmer")])
13
+
let data = dict.from_list([#("name", "Alice"), #("profession", "Programmer")])
14
14
15
15
let assert Ok(Nil) = tiny_database.truncate(connection)
16
16
let assert Ok([]) = tiny_database.list(connection)