<FromGitter>
<wyhaines> @plainas The use of Serializable makes parsing JSON (or YAML), with a structure that you know in advance, really nice. You can define the structure and the parsing behavior in one or more easily read and understood classes.
zorp has quit [Ping timeout: 244 seconds]
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 272 seconds]
<FromGitter>
<plainas> @wyhaines yea I am reading kemal guides and there's an example of deffining JSON.mapping
<FromGitter>
<plainas> works, but I get a deprecation warning.
<FromGitter>
<plainas> looks like many things on kemal use deprecated apis. As warned, the core API has is still expected to have breaking changes
<FromGitter>
<plainas> I might remove kemal and just use the core HTTP module directly. I love kemal but things are changing too fast for it to keep up. I've last used crystal 1.5 years agora. *Many* things have changed since
HumanG33k has joined #crystal-lang
zorp has joined #crystal-lang
gangstacat has quit [Quit: Ĝis!]
gangstacat has joined #crystal-lang
heidar has joined #crystal-lang
<FromGitter>
<j8r> sure, 1.5 years is long for Crystal
<FromGitter>
<Blacksmoke16> could switch to another framework. Have plenty of options these days
<raz>
guerilla marketing detected :p
<raz>
(but yes, would at least refrain from starting new things with kemal atm)
<FromGitter>
<Daniel-Worrall> Json.mapping is part of the guide in the docs which gives deprecation warnings. I believe that's what they meant
<FromGitter>
<ImAHopelessDev_gitlab> did someone mention json.mapping?? i'm here!!
hamoko[m] has quit [Quit: Idle for 30+ days]
<FromGitter>
<j8r> ha yeah the guide can be outdated
<FromGitter>
<j8r> @ImAHopelessDev_gitlab You're still in Crystal 0.30?
early` has joined #crystal-lang
Human_G33k has joined #crystal-lang
<FromGitter>
<plainas> Yeah that is what I mean. I kind of like JSON.mapping better than serializable. more minimal syntax. Doesn't achieve the same as serializeable, but I like it
early has quit [Quit: Leaving]
HumanG33k has quit [Ping timeout: 256 seconds]
<FromGitter>
<Blacksmoke16> how you figure its more minimal? serializable is just 1 line plus the properties you have
sagax has quit [Read error: Connection reset by peer]
<FromGitter>
<dscottboggs_gitlab> nice 👍
<FromGitter>
<brunto> Hi everyone, I’m looking for a way to update the year of a Time `morning_start = Time.parse(start_at, "%R", Time::Location.load("Europe/Berlin"))` I looked to the Crystal API without finding smtg!
<FromGitter>
<dscottboggs_gitlab> you're trying to JUST store time and TZ?
<FromGitter>
<brunto> I need to record a tstzrange inside the DB
<FromGitter>
<dscottboggs_gitlab> oh
<FromGitter>
<brunto> But it’s works like this, thx ;)
<FromGitter>
<Blacksmoke16> not sure i follow, so like a time span?
<FromGitter>
<dscottboggs_gitlab> well, like a time span representing a time from midnight with the TZ encoded too
<FromGitter>
<brunto> I haven’t tried Time::Span I will
<FromGitter>
<dscottboggs_gitlab> that's not a type Crystal has in the stdlib
<FromGitter>
<dscottboggs_gitlab> TBH I think you should define a custom type which stores a second offset and `Time::Location`
<FromGitter>
<brunto> I do a raw query with: `INSERT INTO opening_times (type, day_of_week, during) VALUES ('StoreOpeningTime', 1, tstzrange('1970-01-01 07:00:00 +01:00', '1970-01-01 11:00:00 +01:00', '[]'));` it works like a charm.
<FromGitter>
<dscottboggs_gitlab> oh i see, yeah I guess that can work
<FromGitter>
<Blacksmoke16> still would think it would be easier to use `Time::Span`
<FromGitter>
<brunto> I confirm it works
<FromGitter>
<brunto> @Blacksmoke16 I think too, I’ll try
<FromGitter>
<wontruefree> I posted the Jeremy Woertink interview on youtube if anyone is interested and does not listen to podcasts https://youtu.be/rQ16_IdjIjE
<FromGitter>
<Blacksmoke16> or if anything work with `Time::Span` and have some private method that generates the correct string to use in the query
<FromGitter>
<dscottboggs_gitlab> Thanks for what you do @wontruefree, keep it up!
<FromGitter>
<wontruefree> You are welcome! I am glad you enjoy it
<FromGitter>
<Blacksmoke16> > never been a huge fan of Lucky or Athena though ⏎ ⏎ Depending on when you last gave it a look, its come a long way
<FromGitter>
<dscottboggs_gitlab> yeah it has been probably almost a year
<FromGitter>
<Blacksmoke16> wew
<FromGitter>
<Blacksmoke16> yea deff has evolved quite a lot since then
<FromGitter>
<dscottboggs_gitlab> yeh wouldn't exactly be fair to judge athena by its state that long ago 😅