Compare commits
4 commits
| Author | SHA256 | Date | |
|---|---|---|---|
| bb2cde0315 | |||
| 11e09110e6 | |||
| acdd692d9f | |||
| 1df6c992b2 |
4 changed files with 10 additions and 26 deletions
4
bjo.lock
4
bjo.lock
|
|
@ -1,5 +1,5 @@
|
|||
(lock
|
||||
(locked
|
||||
(package (name (bjosql)) (version "0.4.0")
|
||||
(package (name (bjosql)) (version "0.4.2")
|
||||
(source (git (url "https://github.com/bjoli/bjosql")))
|
||||
(commit "8536b7ea3c887fca244cc65d721a8db9a49d5b51"))))
|
||||
(commit "8c0c1175bdda467c0d961a9c23b80abd75b02d64"))))
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
(package
|
||||
(name (bjopg))
|
||||
(version "0.2.0")
|
||||
(version "0.2.2")
|
||||
(description "PostgreSQL for Bjolang: the bjosql query language over Npgsql, for bjoroutines.")
|
||||
(license "MPL-2.0")
|
||||
|
||||
(depends
|
||||
(package (name (bjosql))
|
||||
(version (version-at-least "0.4.0"))
|
||||
(version (version-at-least "0.4.2"))
|
||||
(source (git (url "https://github.com/bjoli/bjosql")))))
|
||||
|
||||
;; A program using this package declares nothing itself.
|
||||
|
|
|
|||
|
|
@ -1,28 +1,12 @@
|
|||
{
|
||||
"version": 1,
|
||||
"dependencies": {
|
||||
"net10.0": {
|
||||
"net11.0": {
|
||||
"Npgsql": {
|
||||
"type": "Direct",
|
||||
"requested": "[10.0.0, )",
|
||||
"resolved": "10.0.0",
|
||||
"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"
|
||||
}
|
||||
"contentHash": "xZAYhPOU2rUIFpV48xsqhCx9vXs6Y+0jX2LCoSEfDFYMw9jtAOUk3iQsCnDLrFIv9NT3JGMihn7nnuZsPKqJmA=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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-12T10:00:00+02:00" "-3.00"))))
|
||||
(expect "ORDER BY an instant"
|
||||
(list-map (fun (e) (->str (record-ref e happened))) (ok! (fetch db events '(select (order-by happened)))))
|
||||
(list-map (fun (e) (displayed (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"))
|
||||
(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)))))
|
||||
|
|
@ -177,7 +177,7 @@
|
|||
(expect "and read back"
|
||||
(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")
|
||||
(->str (record-ref e note))))
|
||||
(displayed (record-ref e note))))
|
||||
(None (list "none")))
|
||||
(list "the label" "(Some 2026-01-01T00:00:00Z)"))
|
||||
(expect "set back to NULL"
|
||||
|
|
@ -189,8 +189,8 @@
|
|||
(admin #t) (avatar (Some #[1uy 2uy 3uy]))))))
|
||||
(expect "an #:auto key comes back" (record-ref ada id) 1)
|
||||
(expect "the rest of the row"
|
||||
(str (record-ref ada name) " " (->str (record-ref ada email)) " " (double->string (record-ref ada score))
|
||||
" " (->str (record-ref ada admin)) " "
|
||||
(str (record-ref ada name) " " (displayed (record-ref ada email)) " " (double->string (record-ref ada score))
|
||||
" " (displayed (record-ref ada admin)) " "
|
||||
(match (record-ref ada avatar) ((Some b) (int->string (array-length b))) (None "none")))
|
||||
"Ada (Some ada@example.org) 9.5 True 3")
|
||||
(expect "insert-all"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue