Skip to content

Commit

Permalink
chore: Version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
custompro98 committed Jul 12, 2024
1 parent eaa137e commit 68f0a8b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "glibsql"
version = "0.4.0"
version = "0.5.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
Expand Down
2 changes: 1 addition & 1 deletion src/glibsql/http.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub fn build(
)
|> http_request.set_header("Content-Type", "application/json")
|> http_request.set_header("Accept", "application/json")
|> http_request.set_header("User-Agent", "glibsql/0.4.0")
|> http_request.set_header("User-Agent", "glibsql/0.5.0")
|> http_request.set_body(build_json(request)),
)
}
Expand Down
8 changes: 3 additions & 5 deletions src/glibsql/libsql.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import decode
import gleam/dynamic
import gleam/io
import gleam/javascript/promise.{type Promise, await}
import gleam/option.{type Option, None, Some}
import gleam/result
Expand Down Expand Up @@ -61,7 +60,7 @@ pub fn build(config: Config) {
}

@external(javascript, "../libsql_ffi.mjs", "do_build")
fn do_build(url: String, token: String) -> Result(LibsqlClient, GlibsqlError) {
fn do_build(_url: String, _token: String) -> Result(LibsqlClient, GlibsqlError) {
// Erlang target tbd
todo
}
Expand Down Expand Up @@ -111,16 +110,15 @@ pub fn execute(
|> promise.resolve
}
Error(error) -> {
io.debug(error)
promise.resolve(Error(error))
}
}
}

@external(javascript, "../libsql_ffi.mjs", "do_execute")
fn do_execute(
client: LibsqlClient,
query: String,
_client: LibsqlClient,
_query: String,
) -> Promise(Result(String, GlibsqlError)) {
// Erlang target tbd
todo
Expand Down
12 changes: 6 additions & 6 deletions test/glibsql/http_test.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn builder_custom_host_test() {
|> http_request.set_header("Authorization", "Bearer token")
|> http_request.set_header("Content-Type", "application/json")
|> http_request.set_header("Accept", "application/json")
|> http_request.set_header("User-Agent", "glibsql/0.4.0")
|> http_request.set_header("User-Agent", "glibsql/0.5.0")
|> http_request.set_body("{\"baton\":null,\"requests\":[]}")

glibsql.new_request()
Expand All @@ -36,7 +36,7 @@ pub fn builder_no_statements_test() {
|> http_request.set_header("Authorization", "Bearer token")
|> http_request.set_header("Content-Type", "application/json")
|> http_request.set_header("Accept", "application/json")
|> http_request.set_header("User-Agent", "glibsql/0.4.0")
|> http_request.set_header("User-Agent", "glibsql/0.5.0")
|> http_request.set_body("{\"baton\":null,\"requests\":[]}")

glibsql.new_request()
Expand All @@ -57,7 +57,7 @@ pub fn builder_single_statement_test() {
|> http_request.set_header("Authorization", "Bearer token")
|> http_request.set_header("Content-Type", "application/json")
|> http_request.set_header("Accept", "application/json")
|> http_request.set_header("User-Agent", "glibsql/0.4.0")
|> http_request.set_header("User-Agent", "glibsql/0.5.0")
|> http_request.set_body(
"{\"baton\":null,\"requests\":[{\"type\":\"execute\",\"stmt\":{\"sql\":\"SELECT * FROM users\"}},{\"type\":\"close\"}]}",
)
Expand All @@ -82,7 +82,7 @@ pub fn builder_many_statement_test() {
|> http_request.set_header("Authorization", "Bearer token")
|> http_request.set_header("Content-Type", "application/json")
|> http_request.set_header("Accept", "application/json")
|> http_request.set_header("User-Agent", "glibsql/0.4.0")
|> http_request.set_header("User-Agent", "glibsql/0.5.0")
|> http_request.set_body(
"{\"baton\":null,\"requests\":[{\"type\":\"execute\",\"stmt\":{\"sql\":\"SELECT * FROM users\"}},{\"type\":\"execute\",\"stmt\":{\"sql\":\"SELECT * FROM posts\"}},{\"type\":\"close\"}]}",
)
Expand All @@ -108,7 +108,7 @@ pub fn builder_clear_statements_test() {
|> http_request.set_header("Authorization", "Bearer token")
|> http_request.set_header("Content-Type", "application/json")
|> http_request.set_header("Accept", "application/json")
|> http_request.set_header("User-Agent", "glibsql/0.4.0")
|> http_request.set_header("User-Agent", "glibsql/0.5.0")
|> http_request.set_body("{\"baton\":null,\"requests\":[]}")

glibsql.new_request()
Expand All @@ -133,7 +133,7 @@ pub fn builder_baton_test() {
|> http_request.set_header("Authorization", "Bearer token")
|> http_request.set_header("Content-Type", "application/json")
|> http_request.set_header("Accept", "application/json")
|> http_request.set_header("User-Agent", "glibsql/0.4.0")
|> http_request.set_header("User-Agent", "glibsql/0.5.0")
|> http_request.set_body(
"{\"baton\":\"baton\",\"requests\":[{\"type\":\"close\"}]}",
)
Expand Down

0 comments on commit 68f0a8b

Please sign in to comment.