Compare commits

..

No commits in common. "main" and "v0.2.0" have entirely different histories.
main ... v0.2.0

4 changed files with 26 additions and 10 deletions

View file

@ -1,5 +1,5 @@
(lock (lock
(locked (locked
(package (name (bjosql)) (version "0.4.2") (package (name (bjosql)) (version "0.4.0")
(source (git (url "https://github.com/bjoli/bjosql"))) (source (git (url "https://github.com/bjoli/bjosql")))
(commit "8c0c1175bdda467c0d961a9c23b80abd75b02d64")))) (commit "8536b7ea3c887fca244cc65d721a8db9a49d5b51"))))

View file

@ -1,12 +1,12 @@
(package (package
(name (bjopg)) (name (bjopg))
(version "0.2.2") (version "0.2.0")
(description "PostgreSQL for Bjolang: the bjosql query language over Npgsql, for bjoroutines.") (description "PostgreSQL for Bjolang: the bjosql query language over Npgsql, for bjoroutines.")
(license "MPL-2.0") (license "MPL-2.0")
(depends (depends
(package (name (bjosql)) (package (name (bjosql))
(version (version-at-least "0.4.2")) (version (version-at-least "0.4.0"))
(source (git (url "https://github.com/bjoli/bjosql"))))) (source (git (url "https://github.com/bjoli/bjosql")))))
;; A program using this package declares nothing itself. ;; A program using this package declares nothing itself.

View file

@ -1,12 +1,28 @@
{ {
"version": 1, "version": 1,
"dependencies": { "dependencies": {
"net11.0": { "net10.0": {
"Npgsql": { "Npgsql": {
"type": "Direct", "type": "Direct",
"requested": "[10.0.0, )", "requested": "[10.0.0, )",
"resolved": "10.0.0", "resolved": "10.0.0",
"contentHash": "xZAYhPOU2rUIFpV48xsqhCx9vXs6Y+0jX2LCoSEfDFYMw9jtAOUk3iQsCnDLrFIv9NT3JGMihn7nnuZsPKqJmA==" "contentHash": "xZAYhPOU2rUIFpV48xsqhCx9vXs6Y+0jX2LCoSEfDFYMw9jtAOUk3iQsCnDLrFIv9NT3JGMihn7nnuZsPKqJmA==",
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "10.0.0"
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions": {
"type": "Transitive",
"resolved": "10.0.0",
"contentHash": "L3AdmZ1WOK4XXT5YFPEwyt0ep6l8lGIPs7F5OOBZc77Zqeo01Of7XXICy47628sdVl0v/owxYJTe86DTgFwKCA=="
},
"Microsoft.Extensions.Logging.Abstractions": {
"type": "Transitive",
"resolved": "10.0.0",
"contentHash": "FU/IfjDfwaMuKr414SSQNTIti/69bHEMb+QKrskRb26oVqpx3lNFXMjs/RC9ZUuhBhcwDM2BwOgoMw+PZ+beqQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.0"
}
} }
} }
} }

View file

@ -152,7 +152,7 @@
(ignore (ok! (insert db events (event (uuid-v7) "2026-10-12T09:00:00Z" "100.00")))) (ignore (ok! (insert db events (event (uuid-v7) "2026-10-12T09:00:00Z" "100.00"))))
(ignore (ok! (insert db events (event (uuid-v7) "2026-10-12T10:00:00+02:00" "-3.00")))) (ignore (ok! (insert db events (event (uuid-v7) "2026-10-12T10:00:00+02:00" "-3.00"))))
(expect "ORDER BY an instant" (expect "ORDER BY an instant"
(list-map (fun (e) (displayed (record-ref e happened))) (ok! (fetch db events '(select (order-by happened))))) (list-map (fun (e) (->str (record-ref e happened))) (ok! (fetch db events '(select (order-by happened)))))
(list "2026-10-12T08:00:00Z" "2026-10-12T09:00:00Z" "2026-10-12T09:00:00.25Z" "2026-10-12T09:00:00.5Z")) (list "2026-10-12T08:00:00Z" "2026-10-12T09:00:00Z" "2026-10-12T09:00:00.25Z" "2026-10-12T09:00:00.5Z"))
(expect "ORDER BY a version 7 uuid sorts by the time it was made" (expect "ORDER BY a version 7 uuid sorts by the time it was made"
(list-map (fun (e) (decimal->string (record-ref e price))) (ok! (fetch db events '(select (order-by key))))) (list-map (fun (e) (decimal->string (record-ref e price))) (ok! (fetch db events '(select (order-by key)))))
@ -177,7 +177,7 @@
(expect "and read back" (expect "and read back"
(match (ok! (fetch-one db events '(select (where (tag not-null))))) (match (ok! (fetch-one db events '(select (where (tag not-null)))))
((Some e) (list (if (= (some! (record-ref e tag)) label) "the label" "another uuid") ((Some e) (list (if (= (some! (record-ref e tag)) label) "the label" "another uuid")
(displayed (record-ref e note)))) (->str (record-ref e note))))
(None (list "none"))) (None (list "none")))
(list "the label" "(Some 2026-01-01T00:00:00Z)")) (list "the label" "(Some 2026-01-01T00:00:00Z)"))
(expect "set back to NULL" (expect "set back to NULL"
@ -189,8 +189,8 @@
(admin #t) (avatar (Some #[1uy 2uy 3uy])))))) (admin #t) (avatar (Some #[1uy 2uy 3uy]))))))
(expect "an #:auto key comes back" (record-ref ada id) 1) (expect "an #:auto key comes back" (record-ref ada id) 1)
(expect "the rest of the row" (expect "the rest of the row"
(str (record-ref ada name) " " (displayed (record-ref ada email)) " " (double->string (record-ref ada score)) (str (record-ref ada name) " " (->str (record-ref ada email)) " " (double->string (record-ref ada score))
" " (displayed (record-ref ada admin)) " " " " (->str (record-ref ada admin)) " "
(match (record-ref ada avatar) ((Some b) (int->string (array-length b))) (None "none"))) (match (record-ref ada avatar) ((Some b) (int->string (array-length b))) (None "none")))
"Ada (Some ada@example.org) 9.5 True 3") "Ada (Some ada@example.org) 9.5 True 3")
(expect "insert-all" (expect "insert-all"