ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
hightower2 has joined #crystal-lang
hightower2 has quit [Ping timeout: 256 seconds]
notzmv has joined #crystal-lang
ur5us has quit [Ping timeout: 252 seconds]
ur5us has joined #crystal-lang
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]
SamantazFox_ has joined #crystal-lang
ur5us has quit [Ping timeout: 252 seconds]
notzmv has quit [Ping timeout: 240 seconds]
walez has joined #crystal-lang
hightower2 has joined #crystal-lang
notzmv has joined #crystal-lang
yxhuvud has quit [Remote host closed the connection]
yxhuvud has joined #crystal-lang
Chillfox has joined #crystal-lang
Chillfox has quit [Quit: Leaving]
Chillfox has joined #crystal-lang
Chillfox has quit [Client Quit]
Chillfox has joined #crystal-lang
Chillfox has quit [Client Quit]
Chillfox has joined #crystal-lang
Chillfox has quit [Client Quit]
Chillfox has joined #crystal-lang
Chillfox has quit [Remote host closed the connection]
Chillfox has joined #crystal-lang
Chillfox has quit [Client Quit]
Chillfox has joined #crystal-lang
Chillfox has quit [Ping timeout: 260 seconds]
fifr has quit [Quit: ZNC 1.8.2 - https://znc.in]
fifr has joined #crystal-lang
walez has quit [Ping timeout: 252 seconds]
<FromGitter> <mehmethankut_twitter> what is your favorite crystal ORM in 2021?
<FromGitter> <Blacksmoke16> https://crystal-lang.github.io/crystal-db/api/0.10.1/DB/Serializable.html has been working well enough for me imo
<FromGitter> <erdnaxeli:cervoi.se> oooh why I didn't know about this before
<FromGitter> <mehmethankut_twitter> > https://crystal-lang.github.io/crystal-db/api/0.10.1/DB/Serializable.html has been working well enough for me imo ⏎ ⏎ that's really cool
<FromGitter> <Blacksmoke16> doesnt handle saving, but for that i found it easy enough to just write something that destructs an object into a prepared statement, like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=61ba2969440178658b9845ae]
<FromGitter> <Blacksmoke16> er updated for the insert case
<FromGitter> <mehmethankut_twitter> I actually handled savings thanks to macro, I am saving attributes to an hash, using them later when I need to save
<FromGitter> <mehmethankut_twitter> I guess I will also create a query builder and combine it with that std stuff you've sent
<FromGitter> <Blacksmoke16> there are ORMs if you still want to go that route, Granite, Jennifer, Clear are all options
<FromGitter> <mehmethankut_twitter> I only checked Clear, it looks really cool except hash input for select part
<FromGitter> <mehmethankut_twitter> I will check out the others as well
<FromGitter> <mehmethankut_twitter> thanks a lot
<hightower2> Avram?
<FromGitter> <Blacksmoke16> afaik that ones tightly coupled to Lucky
<hightower2> I was checking its docs a couple times and didn't notice any particular assumptions of the rest of Lucky being used. Would someone know in more detail which case is the case? :)
<FromGitter> <Blacksmoke16> https://gist.github.com/Blacksmoke16/ee7e6d2b6414e3029481aa4d494ace5f is how i handled things. Is a bit coupled to Athena, but could use a singleton const of `EntityManager` and would work just as good. could also keep it an ivar with a default value of that singleton, just to make testing easier. As mentioned in the comments, it deff could be cleanedup/improved a bit more but :shrug: was a quick
<FromGitter> ... implementation just to get something working
<FromGitter> <mehmethankut_twitter> Athena is your framework right?
<FromGitter> <Blacksmoke16> yea
walez has joined #crystal-lang
Starfoxxes has quit [Ping timeout: 252 seconds]
notzmv has quit [Read error: Connection reset by peer]
Starfoxxes has joined #crystal-lang
ur5us has joined #crystal-lang
<riza> if I have an array of size 1, but I want to expand it ... is teh only way to trigger that expansion to do a <<?
<riza> even if I know and pre-allocate the size for the array, it still nopes me https://play.crystal-lang.org/#/r/cg3t
<riza> well thats good -- but in my last example I already have the capacity and it's still throwing
<FromGitter> <Blacksmoke16> this is expected i think since you cant skip an index
<FromGitter> <Blacksmoke16> so would need to fill up the array with values first
<riza> like that?
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/cg3x
walez has quit [Ping timeout: 252 seconds]
<riza> if I want an Array(Array(T)), does that result in each Array(T) being a pointer to the same?
<riza> I guess block notation then: https://play.crystal-lang.org/#/r/cg40
<riza> yeah that did it. man that was more painful than expected...
<riza> thanks for the help as always Blacksmoke, if I got paid for my mindless fiddling I'd owe you a tip
<riza> well I still owe you a tip, honestly
<FromGitter> <Blacksmoke16> haha all good
<raz> mehmethankut_twitter, clear ORM for me
<raz> oh wow, i never saw DB::Serializable tho. also looks neat for when you don't want the boon & bane of an actual ORM.
hightower2 has quit [Ping timeout: 260 seconds]
hightower2 has joined #crystal-lang
ur5us has quit [Ping timeout: 252 seconds]
sagax has joined #crystal-lang
<FromGitter> <Blacksmoke16> yes, that + a few simple abstractions gets you most of the benefit w/o the complexity
notzmv has joined #crystal-lang