Packages

A modern, type-safe Gleam library to integrate with the Cloudflare D1 REST API.

Retired package: Release invalid - docs was not updated

Current section

3 Versions

Jump to

Compare versions

5 files changed
+20 additions
-16 deletions
  @@ -1,5 +1,11 @@
1 1 # d1_gleamflare
2 2
3 + [![Hex Package](https://img.shields.io/hexpm/v/d1_gleamflare.svg)](https://hex.pm/packages/d1_gleamflare)
4 + [![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/d1_gleamflare/)
5 + [![License](https://img.shields.io/hexpm/l/d1_gleamflare)](https://github.com/juliocabrera820/d1-gleamflare/blob/main/LICENSE)
6 + [![Gleam](https://img.shields.io/badge/gleam-%3E%3D%201.3.0-FFAFF3)](https://gleam.run)
7 + [![Target](https://img.shields.io/badge/target-erlang-B83998?logo=erlang)](https://www.erlang.org/)
8 +
3 9 A modern, type-safe Gleam library to integrate with the Cloudflare D1 REST API. Specifically built to target the Erlang VM (BEAM) using `gleam_httpc`.
4 10
5 11 ## Installation
  @@ -8,7 +14,7 @@ Add `d1_gleamflare` to your `gleam.toml` dependencies:
8 14
9 15 ```toml
10 16 [dependencies]
11 - d1_gleamflare = ">= 0.1.0"
17 + d1_gleamflare = ">= 1.0.0"
12 18 ```
13 19
14 20 ## Quick Start
  @@ -20,10 +26,7 @@ To interact with the Cloudflare API, you need your Cloudflare Account ID and a C
20 26 ```gleam
21 27 import d1_gleamflare
22 28
23 - let client = d1_gleamflare.new(
24 - account_id: "your-account-id",
25 - api_token: "your-api-token",
26 - )
29 + let client = d1_gleamflare.new("your-account-id", "your-api-token")
27 30 ```
28 31
29 32 ### 2. Manage Databases (Account-Level)
  @@ -74,7 +77,7 @@ fn user_decoder() {
74 77
75 78 // Execute SELECT query
76 79 let sql = "SELECT id, name, email FROM users WHERE active = ? AND age >= ?"
77 - let params = [json.bool(true), json.int(21)]
80 + let params = [json.bool(True), json.int(21)]
78 81
79 82 let assert Ok(query_result) =
80 83 db
  @@ -1,7 +1,8 @@
1 1 name = "d1_gleamflare"
2 - version = "1.0.0"
2 + version = "1.0.1"
3 3 target = "erlang"
4 4
5 + gleam = ">= 1.3.0"
5 6 description = "A modern, type-safe Gleam library to integrate with the Cloudflare D1 REST API."
6 7 licences = ["Apache-2.0"]
7 8 repository = { type = "github", user = "juliocabrera820", repo = "d1-gleamflare" }
  @@ -1,6 +1,6 @@
1 1 {<<"name">>, <<"d1_gleamflare"/utf8>>}.
2 2 {<<"app">>, <<"d1_gleamflare"/utf8>>}.
3 - {<<"version">>, <<"1.0.0"/utf8>>}.
3 + {<<"version">>, <<"1.0.1"/utf8>>}.
4 4 {<<"description">>, <<"A modern, type-safe Gleam library to integrate with the Cloudflare D1 REST API."/utf8>>}.
5 5 {<<"licenses">>, [<<"Apache-2.0"/utf8>>]}.
6 6 {<<"build_tools">>, [<<"gleam"/utf8>>]}.
  @@ -9,20 +9,20 @@
9 9 {<<"Repository"/utf8>>, <<"https://github.com/juliocabrera820/d1-gleamflare"/utf8>>}
10 10 ]}.
11 11 {<<"requirements">>, [
12 - {<<"gleam_http"/utf8>>, [
13 - {<<"app">>, <<"gleam_http"/utf8>>},
12 + {<<"gleam_json"/utf8>>, [
13 + {<<"app">>, <<"gleam_json"/utf8>>},
14 14 {<<"optional">>, false},
15 - {<<"requirement">>, <<">= 3.0.0 and < 4.0.0"/utf8>>}
15 + {<<"requirement">>, <<">= 1.0.0 and < 2.0.0"/utf8>>}
16 16 ]},
17 17 {<<"gleam_httpc"/utf8>>, [
18 18 {<<"app">>, <<"gleam_httpc"/utf8>>},
19 19 {<<"optional">>, false},
20 20 {<<"requirement">>, <<">= 2.0.0 and < 3.0.0"/utf8>>}
21 21 ]},
22 - {<<"gleam_json"/utf8>>, [
23 - {<<"app">>, <<"gleam_json"/utf8>>},
22 + {<<"gleam_http"/utf8>>, [
23 + {<<"app">>, <<"gleam_http"/utf8>>},
24 24 {<<"optional">>, false},
25 - {<<"requirement">>, <<">= 1.0.0 and < 2.0.0"/utf8>>}
25 + {<<"requirement">>, <<">= 3.0.0 and < 4.0.0"/utf8>>}
26 26 ]},
27 27 {<<"gleam_stdlib"/utf8>>, [
28 28 {<<"app">>, <<"gleam_stdlib"/utf8>>},
  @@ -1,5 +1,5 @@
1 1 {application, d1_gleamflare, [
2 - {vsn, "1.0.0"},
2 + {vsn, "1.0.1"},
3 3 {applications, [gleam_http,
4 4 gleam_httpc,
5 5 gleam_json,
  @@ -4,7 +4,7 @@ import gleam/json
4 4 import gleam/dynamic.{type Decoder, type Dynamic}
5 5 import gleam/option.{type Option}
6 6 import gleam/list
7 - import d1_gleamflare/types.{type Database, type Query, type QueryMeta, type QueryResult, Database, Query, QueryMeta, QueryResult}
7 + import d1_gleamflare/types.{type Database, type Query, type QueryMeta, type QueryResult, QueryMeta, QueryResult}
8 8 import d1_gleamflare/internal
9 9
10 10 pub fn query_to_json(q: Query) -> json.Json {