-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
46 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ log | |
logs | ||
rebar3.crashdump | ||
doc | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,18 @@ | ||
name = "gleam_pgo" | ||
version = "0.1.1" | ||
version = "0.2.0" | ||
licences = ["Apache-2.0"] | ||
description = "Gleam bindings to the PGO PostgreSQL client" | ||
|
||
repository = { type = "github", user = "gleam-experiments", repo = "pgo" } | ||
links = [ | ||
{ title = "Website", href = "https://gleam.run" }, | ||
{ title = "Sponsor", href = "https://github.com/sponsors/lpil" }, | ||
] | ||
|
||
[dependencies] | ||
gleam_stdlib = "0.19.0" | ||
gleam_erlang = "~> 0.8" | ||
pgo = "~> 0.11" | ||
|
||
[dev-dependencies] | ||
gleeunit = "~> 0.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This file was generated by Gleam | ||
# You typically do not need to edit this file | ||
|
||
packages = [ | ||
{ name = "backoff", version = "1.1.6", build_tools = ["rebar3"], requirements = [], otp_app = "backoff", source = "hex", outer_checksum = "CF0CFFF8995FB20562F822E5CC47D8CCF664C5ECDC26A684CBE85C225F9D7C39" }, | ||
{ name = "gleam_erlang", version = "0.8.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "AF437B787D8FFE3608BA71AB879FBAAC52B2B3312F09403C27B1847476588313" }, | ||
{ name = "gleam_stdlib", version = "0.19.3", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "14AC79B463A08A428B5802051D3E660AFB0B0A075A630DFBC3E0F45B28D79139" }, | ||
{ name = "gleeunit", version = "0.6.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "77701A5E5A565727E1EEAC9196FB878D544049B6331CD0305B5A69699135EA1C" }, | ||
{ name = "pg_types", version = "0.4.0", build_tools = ["rebar3"], requirements = [], otp_app = "pg_types", source = "hex", outer_checksum = "B02EFA785CAECECF9702C681C80A9CA12A39F9161A846CE17B01FB20AEEED7EB" }, | ||
{ name = "pgo", version = "0.11.1", build_tools = ["rebar3"], requirements = ["telemetry", "backoff", "pg_types"], otp_app = "pgo", source = "hex", outer_checksum = "30F38CA823A98C41EF23967D133E91B45AD14AEE0766F4773E88BCCF46BA17A5" }, | ||
{ name = "telemetry", version = "0.4.3", build_tools = ["rebar3"], requirements = [], otp_app = "telemetry", source = "hex", outer_checksum = "EB72B8365FFDA5BED68A620D1DA88525E326CB82A75EE61354FC24B844768041" }, | ||
] | ||
|
||
[requirements] | ||
gleam_erlang = "~> 0.8" | ||
gleam_stdlib = "0.19.0" | ||
gleeunit = "~> 0.6" | ||
pgo = "~> 0.11" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import gleam/int | |
import gleam/io | ||
import gleam/pgo | ||
import gleam/string | ||
import gleam/should | ||
import gleeunit/should | ||
|
||
pub fn url_config_test() { | ||
pgo.url_config("postgres://u:[email protected]:1234/my_db") | ||
|
@@ -84,8 +84,7 @@ pub fn selecting_rows_test() { | |
RETURNING | ||
id" | ||
assert Ok(#(_, _, [row])) = pgo.query(conn, sql, []) | ||
assert Ok(id) = dynamic.element(row, 0) | ||
assert Ok(id) = dynamic.int(id) | ||
assert Ok(id) = dynamic.element(0, dynamic.int)(row) | ||
let sql = string.append("SELECT * FROM cats WHERE id = ", int.to_string(id)) | ||
assert Ok(response) = pgo.query(conn, sql, []) | ||
response.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import gleeunit | ||
|
||
pub fn main() { | ||
gleeunit.main() | ||
} |