Skip to content

Commit

Permalink
fixed demos
Browse files Browse the repository at this point in the history
  • Loading branch information
inoas committed Nov 14, 2024
1 parent 87d49a2 commit 10dc369
Show file tree
Hide file tree
Showing 40 changed files with 184 additions and 248 deletions.
8 changes: 4 additions & 4 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
erlang 26.2.5.5
gleam 1.5.1
# erlang 27.1.2
# gleam nightly
# erlang 26.2.5.5
# gleam 1.5.1
erlang 27.1.2
gleam nightly
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- `select_col`
- `replace_select_col`
- Replaced dev/test and adapter target `gleam_pgo` with `pgo` dependency.
- Updated demos.

## [2.0.2] - 2024-11-03

Expand Down
3 changes: 1 addition & 2 deletions docs/demo-apps/demos/01_select_and_decode/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# erlang 26.2.5.1
erlang 27.0
gleam 1.3.2
# erlang 26.2.5.1
gleam 1.5.1
# gleam nightly
5 changes: 3 additions & 2 deletions docs/demo-apps/demos/01_select_and_decode/gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name = "cake_demo_select_and_decode"
description = "An demo of using Gleam with Cake and 🐘PostgreSQL to run SELECT queries and decode returning data into Gleam records"

[dependencies]
cake = { path = "../../../../" }
cake = { path = "../../../.." }
cake_pog = ">= 1.0.3 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
helper = { path = "../../helper" }
pog = ">= 1.0.0 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
pprint = ">= 1.0.3 and < 2.0.0"
21 changes: 11 additions & 10 deletions docs/demo-apps/demos/01_select_and_decode/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

packages = [
{ name = "backoff", version = "1.1.6", build_tools = ["rebar3"], requirements = [], otp_app = "backoff", source = "hex", outer_checksum = "CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39" },
{ name = "cake", version = "0.15.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../../../.." },
{ name = "helper", version = "1.0.0", build_tools = ["gleam"], requirements = ["cake", "pog", "gleam_stdlib", "pprint"], source = "local", path = "../../helper" },
{ name = "cake", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../../../.." },
{ name = "cake_pog", version = "1.0.3", build_tools = ["gleam"], requirements = ["cake", "gleam_stdlib", "pog"], otp_app = "cake_pog", source = "hex", outer_checksum = "8889AB1F7F5EE8F470882D78DC66F942341CB823631EBDFE868D3F983C380D83" },
{ name = "glam", version = "2.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glam", source = "hex", outer_checksum = "66EC3BCD632E51EED029678F8DF419659C1E57B1A93D874C5131FE220DFAD2B2" },
{ name = "pog", version = "0.13.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "pgo"], otp_app = "pog", source = "hex", outer_checksum = "6A1E7F3E717C077788254871E4EF4A8DFF58FEC07D7FA7C7702C2CCF66095AC8" },
{ name = "gleam_stdlib", version = "0.39.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "2D7DE885A6EA7F1D5015D1698920C9BAF7241102836CE0C3837A4F160128A9C4" },
{ name = "opentelemetry_api", version = "1.3.0", build_tools = ["rebar3", "mix"], requirements = ["opentelemetry_semantic_conventions"], otp_app = "opentelemetry_api", source = "hex", outer_checksum = "B9E5FF775FD064FA098DBA3C398490B77649A352B40B0B730A6B7DC0BDD68858" },
{ name = "opentelemetry_semantic_conventions", version = "0.2.0", build_tools = ["rebar3", "mix"], requirements = [], otp_app = "opentelemetry_semantic_conventions", source = "hex", outer_checksum = "D61FA1F5639EE8668D74B527E6806E0503EFC55A42DB7B5F39939D84C07D6895" },
{ name = "gleam_stdlib", version = "0.41.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1B2F80CB1B66B027E3198A2FF71EF3F2F31DF89ED97AD606F25FD387A4C3C1EF" },
{ name = "helper", version = "1.0.1", build_tools = ["gleam"], requirements = ["cake", "cake_pog", "gleam_stdlib", "pog", "pprint"], source = "local", path = "../../helper" },
{ name = "opentelemetry_api", version = "1.4.0", build_tools = ["rebar3", "mix"], requirements = [], otp_app = "opentelemetry_api", source = "hex", outer_checksum = "3DFBBFAA2C2ED3121C5C483162836C4F9027DEF469C41578AF5EF32589FCFC58" },
{ name = "pg_types", version = "0.4.0", build_tools = ["rebar3"], requirements = [], otp_app = "pg_types", source = "hex", outer_checksum = "B02EFA785CAECECF9702C681C80A9CA12A39F9161A846CE17B01FB20AEEED7EB" },
{ name = "pgo", version = "0.14.0", build_tools = ["rebar3"], requirements = ["backoff", "opentelemetry_api", "pg_types"], otp_app = "pgo", source = "hex", outer_checksum = "71016C22599936E042DC0012EE4589D24C71427D266292F775EBF201D97DF9C9" },
{ name = "pprint", version = "1.0.3", build_tools = ["gleam"], requirements = ["glam", "gleam_stdlib"], otp_app = "pprint", source = "hex", outer_checksum = "76BBB92E23D12D954BD452686543F29EDE8EBEBB7FC0ACCBCA66EEF276EC3A06" },
{ name = "pog", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "pgo"], otp_app = "pog", source = "hex", outer_checksum = "00D57120936AFBF486BE357C472E483C1F0CA507FF9C3668075E87C733CA53F8" },
{ name = "pprint", version = "1.0.4", build_tools = ["gleam"], requirements = ["glam", "gleam_stdlib"], otp_app = "pprint", source = "hex", outer_checksum = "C310A98BDC0995644847C3C8702DE19656D6BCD638B2A8A358B97824379ECAA1" },
]

[requirements]
cake = { path = "../../../../" }
helper = { path = "../../helper" }
pog = { version = ">= 0.13.0 and < 2.0.0" }
cake = { path = "../../../.." }
cake_pog = { version = ">= 1.0.3 and < 2.0.0" }
gleam_stdlib = { version = ">= 0.39.0 and < 2.0.0" }
helper = { path = "../../helper" }
pog = { version = ">= 1.0.0 and < 2.0.0" }
pprint = { version = ">= 1.0.3 and < 2.0.0" }
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import cake/adapter/postgres
import cake/join as j
import cake/select as s
import cake/where as w
Expand All @@ -6,7 +7,7 @@ import gleam/dynamic
import gleam/io
import gleam/list
import helper/demo_data
import helper/postgres
import helper/postgres_helper
import pprint

fn select_query() {
Expand All @@ -33,7 +34,7 @@ fn select_query() {
}

pub fn main() {
use conn <- postgres.with_connection
use conn <- postgres_helper.with_connection
demo_data.create_tables_and_insert_rows(conn)

let assert Ok(cats) =
Expand Down
4 changes: 2 additions & 2 deletions docs/demo-apps/demos/02_union_and_decode/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
erlang 27.0
gleam 1.3.0
# erlang 26.2.5.1
erlang 27.0
gleam 1.5.1
# gleam nightly
5 changes: 3 additions & 2 deletions docs/demo-apps/demos/02_union_and_decode/gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name = "cake_demo_union_and_decode"
description = "An demo of using Gleam with Cake and 🐘PostgreSQL to run UNION queries and decode returning data into Gleam records"

[dependencies]
cake = { path = "../../../../" }
cake = { path = "../../../.." }
cake_pog = ">= 1.0.3 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
helper = { path = "../../helper" }
pog = ">= 1.0.0 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
pprint = ">= 1.0.3 and < 2.0.0"
21 changes: 11 additions & 10 deletions docs/demo-apps/demos/02_union_and_decode/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

packages = [
{ name = "backoff", version = "1.1.6", build_tools = ["rebar3"], requirements = [], otp_app = "backoff", source = "hex", outer_checksum = "CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39" },
{ name = "cake", version = "0.15.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../../../.." },
{ name = "helper", version = "1.0.0", build_tools = ["gleam"], requirements = ["cake", "pog", "gleam_stdlib", "pprint"], source = "local", path = "../../helper" },
{ name = "cake", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../../../.." },
{ name = "cake_pog", version = "1.0.3", build_tools = ["gleam"], requirements = ["cake", "gleam_stdlib", "pog"], otp_app = "cake_pog", source = "hex", outer_checksum = "8889AB1F7F5EE8F470882D78DC66F942341CB823631EBDFE868D3F983C380D83" },
{ name = "glam", version = "2.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glam", source = "hex", outer_checksum = "66EC3BCD632E51EED029678F8DF419659C1E57B1A93D874C5131FE220DFAD2B2" },
{ name = "pog", version = "0.13.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "pgo"], otp_app = "pog", source = "hex", outer_checksum = "6A1E7F3E717C077788254871E4EF4A8DFF58FEC07D7FA7C7702C2CCF66095AC8" },
{ name = "gleam_stdlib", version = "0.39.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "2D7DE885A6EA7F1D5015D1698920C9BAF7241102836CE0C3837A4F160128A9C4" },
{ name = "opentelemetry_api", version = "1.3.0", build_tools = ["rebar3", "mix"], requirements = ["opentelemetry_semantic_conventions"], otp_app = "opentelemetry_api", source = "hex", outer_checksum = "B9E5FF775FD064FA098DBA3C398490B77649A352B40B0B730A6B7DC0BDD68858" },
{ name = "opentelemetry_semantic_conventions", version = "0.2.0", build_tools = ["rebar3", "mix"], requirements = [], otp_app = "opentelemetry_semantic_conventions", source = "hex", outer_checksum = "D61FA1F5639EE8668D74B527E6806E0503EFC55A42DB7B5F39939D84C07D6895" },
{ name = "gleam_stdlib", version = "0.41.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1B2F80CB1B66B027E3198A2FF71EF3F2F31DF89ED97AD606F25FD387A4C3C1EF" },
{ name = "helper", version = "1.0.1", build_tools = ["gleam"], requirements = ["cake", "cake_pog", "gleam_stdlib", "pog", "pprint"], source = "local", path = "../../helper" },
{ name = "opentelemetry_api", version = "1.4.0", build_tools = ["rebar3", "mix"], requirements = [], otp_app = "opentelemetry_api", source = "hex", outer_checksum = "3DFBBFAA2C2ED3121C5C483162836C4F9027DEF469C41578AF5EF32589FCFC58" },
{ name = "pg_types", version = "0.4.0", build_tools = ["rebar3"], requirements = [], otp_app = "pg_types", source = "hex", outer_checksum = "B02EFA785CAECECF9702C681C80A9CA12A39F9161A846CE17B01FB20AEEED7EB" },
{ name = "pgo", version = "0.14.0", build_tools = ["rebar3"], requirements = ["backoff", "opentelemetry_api", "pg_types"], otp_app = "pgo", source = "hex", outer_checksum = "71016C22599936E042DC0012EE4589D24C71427D266292F775EBF201D97DF9C9" },
{ name = "pprint", version = "1.0.3", build_tools = ["gleam"], requirements = ["glam", "gleam_stdlib"], otp_app = "pprint", source = "hex", outer_checksum = "76BBB92E23D12D954BD452686543F29EDE8EBEBB7FC0ACCBCA66EEF276EC3A06" },
{ name = "pog", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "pgo"], otp_app = "pog", source = "hex", outer_checksum = "00D57120936AFBF486BE357C472E483C1F0CA507FF9C3668075E87C733CA53F8" },
{ name = "pprint", version = "1.0.4", build_tools = ["gleam"], requirements = ["glam", "gleam_stdlib"], otp_app = "pprint", source = "hex", outer_checksum = "C310A98BDC0995644847C3C8702DE19656D6BCD638B2A8A358B97824379ECAA1" },
]

[requirements]
cake = { path = "../../../../" }
helper = { path = "../../helper" }
pog = { version = ">= 0.13.0 and < 2.0.0" }
cake = { path = "../../../.." }
cake_pog = { version = ">= 1.0.3 and < 2.0.0" }
gleam_stdlib = { version = ">= 0.39.0 and < 2.0.0" }
helper = { path = "../../helper" }
pog = { version = ">= 1.0.0 and < 2.0.0" }
pprint = { version = ">= 1.0.3 and < 2.0.0" }
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import being
import cake/adapter/postgres
import cake/combined as c
import cake/select as s
import gleam/dynamic
import gleam/io
import gleam/list
import helper/demo_data
import helper/postgres
import helper/postgres_helper
import pprint

fn union_query() {
Expand All @@ -25,7 +26,7 @@ fn union_query() {
}

pub fn main() {
use conn <- postgres.with_connection
use conn <- postgres_helper.with_connection
demo_data.create_tables_and_insert_rows(conn)

let assert Ok(beings) =
Expand Down
2 changes: 1 addition & 1 deletion docs/demo-apps/demos/03_insert/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# erlang 26.2.5.1
erlang 27.0
gleam 1.3.2
gleam 1.5.1
# gleam nightly
5 changes: 3 additions & 2 deletions docs/demo-apps/demos/03_insert/gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name = "cake_demo_insert"
description = "An demo of using Gleam with Cake and 🐘PostgreSQL to run INSERT queries"

[dependencies]
cake = { path = "../../../../" }
cake = { path = "../../../.." }
cake_pog = ">= 1.0.3 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
helper = { path = "../../helper" }
pog = ">= 1.0.0 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
pprint = ">= 1.0.3 and < 2.0.0"
21 changes: 11 additions & 10 deletions docs/demo-apps/demos/03_insert/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

packages = [
{ name = "backoff", version = "1.1.6", build_tools = ["rebar3"], requirements = [], otp_app = "backoff", source = "hex", outer_checksum = "CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39" },
{ name = "cake", version = "0.15.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../../../.." },
{ name = "helper", version = "1.0.0", build_tools = ["gleam"], requirements = ["cake", "pog", "gleam_stdlib", "pprint"], source = "local", path = "../../helper" },
{ name = "cake", version = "2.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], source = "local", path = "../../../.." },
{ name = "cake_pog", version = "1.0.3", build_tools = ["gleam"], requirements = ["cake", "gleam_stdlib", "pog"], otp_app = "cake_pog", source = "hex", outer_checksum = "8889AB1F7F5EE8F470882D78DC66F942341CB823631EBDFE868D3F983C380D83" },
{ name = "glam", version = "2.0.1", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glam", source = "hex", outer_checksum = "66EC3BCD632E51EED029678F8DF419659C1E57B1A93D874C5131FE220DFAD2B2" },
{ name = "pog", version = "0.13.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "pgo"], otp_app = "pog", source = "hex", outer_checksum = "6A1E7F3E717C077788254871E4EF4A8DFF58FEC07D7FA7C7702C2CCF66095AC8" },
{ name = "gleam_stdlib", version = "0.39.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "2D7DE885A6EA7F1D5015D1698920C9BAF7241102836CE0C3837A4F160128A9C4" },
{ name = "opentelemetry_api", version = "1.3.0", build_tools = ["rebar3", "mix"], requirements = ["opentelemetry_semantic_conventions"], otp_app = "opentelemetry_api", source = "hex", outer_checksum = "B9E5FF775FD064FA098DBA3C398490B77649A352B40B0B730A6B7DC0BDD68858" },
{ name = "opentelemetry_semantic_conventions", version = "0.2.0", build_tools = ["rebar3", "mix"], requirements = [], otp_app = "opentelemetry_semantic_conventions", source = "hex", outer_checksum = "D61FA1F5639EE8668D74B527E6806E0503EFC55A42DB7B5F39939D84C07D6895" },
{ name = "gleam_stdlib", version = "0.41.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "1B2F80CB1B66B027E3198A2FF71EF3F2F31DF89ED97AD606F25FD387A4C3C1EF" },
{ name = "helper", version = "1.0.1", build_tools = ["gleam"], requirements = ["cake", "cake_pog", "gleam_stdlib", "pog", "pprint"], source = "local", path = "../../helper" },
{ name = "opentelemetry_api", version = "1.4.0", build_tools = ["rebar3", "mix"], requirements = [], otp_app = "opentelemetry_api", source = "hex", outer_checksum = "3DFBBFAA2C2ED3121C5C483162836C4F9027DEF469C41578AF5EF32589FCFC58" },
{ name = "pg_types", version = "0.4.0", build_tools = ["rebar3"], requirements = [], otp_app = "pg_types", source = "hex", outer_checksum = "B02EFA785CAECECF9702C681C80A9CA12A39F9161A846CE17B01FB20AEEED7EB" },
{ name = "pgo", version = "0.14.0", build_tools = ["rebar3"], requirements = ["backoff", "opentelemetry_api", "pg_types"], otp_app = "pgo", source = "hex", outer_checksum = "71016C22599936E042DC0012EE4589D24C71427D266292F775EBF201D97DF9C9" },
{ name = "pprint", version = "1.0.3", build_tools = ["gleam"], requirements = ["glam", "gleam_stdlib"], otp_app = "pprint", source = "hex", outer_checksum = "76BBB92E23D12D954BD452686543F29EDE8EBEBB7FC0ACCBCA66EEF276EC3A06" },
{ name = "pog", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "pgo"], otp_app = "pog", source = "hex", outer_checksum = "00D57120936AFBF486BE357C472E483C1F0CA507FF9C3668075E87C733CA53F8" },
{ name = "pprint", version = "1.0.4", build_tools = ["gleam"], requirements = ["glam", "gleam_stdlib"], otp_app = "pprint", source = "hex", outer_checksum = "C310A98BDC0995644847C3C8702DE19656D6BCD638B2A8A358B97824379ECAA1" },
]

[requirements]
cake = { path = "../../../../" }
helper = { path = "../../helper" }
pog = { version = ">= 0.13.0 and < 2.0.0" }
cake = { path = "../../../.." }
cake_pog = { version = ">= 1.0.3 and < 2.0.0" }
gleam_stdlib = { version = ">= 0.39.0 and < 2.0.0" }
helper = { path = "../../helper" }
pog = { version = ">= 1.0.0 and < 2.0.0" }
pprint = { version = ">= 1.0.3 and < 2.0.0" }
6 changes: 4 additions & 2 deletions docs/demo-apps/demos/03_insert/src/cake_demo_insert.gleam
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import cake/adapter/postgres
import cake/insert as i
import gleam/dynamic
import gleam/io
import helper/demo_data
import helper/postgres
import helper/postgres_helper

import pprint

fn insert_query() {
Expand All @@ -17,7 +19,7 @@ fn insert_query() {
}

pub fn main() {
use conn <- postgres.with_connection
use conn <- postgres_helper.with_connection
demo_data.create_tables_and_insert_rows(conn)

let result = insert_query() |> postgres.run_write_query(dynamic.dynamic, conn)
Expand Down
2 changes: 1 addition & 1 deletion docs/demo-apps/demos/04_delete/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# erlang 26.2.5.1
erlang 27.0
gleam 1.3.2
gleam 1.5.1
# gleam nightly
5 changes: 3 additions & 2 deletions docs/demo-apps/demos/04_delete/gleam.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name = "cake_demo_delete"
description = "An demo of using Gleam with Cake and 🐘PostgreSQL to run DELETE queries"

[dependencies]
cake = { path = "../../../../" }
cake = { path = "../../../.." }
cake_pog = ">= 1.0.3 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
helper = { path = "../../helper" }
pog = ">= 1.0.0 and < 2.0.0"
gleam_stdlib = ">= 0.39.0 and < 2.0.0"
pprint = ">= 1.0.3 and < 2.0.0"
Loading

0 comments on commit 10dc369

Please sign in to comment.