in lib/onyx-http/src/onyx-http/middleware/renderer/rest_error.html.ecr:4: undefined constant ::HTTP::Status
shards installfor now.
time_format.crrepository and creating new https://github.com/vladfaust/time-span-humanize. If you encounter any errors regarding to shards from now, you should delete
shard.lockand also clean
jsonmacro is used, and it seems the
context.request.bodyis already consumed by it before the
beforecallback is called. Any ideas?
context.request.body.rewind), but I'm not sure if it would work 🤔. For some reason in current release there is no way to preserve the body... Another workaround is to copy the body in a handler (i.e. custom middleware)
rewindis unimplemented since the
bodyI’m getting is a
FixedLengthContent < IO::Sized: https://github.com/crystal-lang/crystal/blob/b42631e9b3c62621f42832755427d530c6e452d2/src/http/common.cr#L37 I tried to patch
HTTP::Requestlike this: qszhu/http@d15c225 It works, but it feels awkward (and possibly with additional memory impact?). I’m still new to crystal, so any suggestion is welcome.
HTTP::Requestclass) would indeed affect the performance. That's why I've opened onyxframework/http#77. Note that the body is read on json and form params parsing only, and it should stay unread in an endpoint if no such a parsing happened
DEBUG [19:56:36.550 #1] [redis] CLIENT ID Unhandled exception: NOAUTH Authentication required. (MiniRedis::Error) from ??? from /usr/share/crystal/src/pointer.cr:434:13 in 'receive' from lib/mini_redis/src/mini_redis.cr:176:15 in 'send_impl' from lib/mini_redis/src/mini_redis.cr:89:5 in '???' from lib/onyx-http/src/onyx-http/ext/http/request/path_params.cr:1:1 in '__crystal_main' from /usr/share/crystal/src/crystal/main.cr:47:14 in 'main' from __libc_start_main from _start from ???
I’m trying to return all the fields of a reference with
join according to the doc: https://docs.onyxframework.org/sql/query.html#join Say I want to get all the fields of
author. Do I have to write raw sql like
.join(author: true) do |x| x.select(“author.*”) end
or is there any other way?
Hey @qszhu, sorry for the late response. You can do this:
.join(author: true, &.select(User))
This would effectively select all the fields of the author with proper table naming
author. instead of