<FromGitter>
<bigtunacan> syntax error at or near "," (PQ::PQError) ⏎ 0x10cb6ee65: *CallStack::unwind:Array(Pointer(Void)) at ?? ⏎ 0x10cb6ee01: *CallStack#initialize:Array(Pointer(Void)) at ?? ⏎ 0x10cb6edd8: *CallStack::new:CallStack at ?? ⏎ 0x10cb6d281: *raise<PQ::PQError>:NoReturn at ?? [https://gitter.im/crystal-lang/crystal?at=5949d651e59e74be0a9d6e0b]
<FromGitter>
<bigtunacan> Forget it; brain fart.
<FromGitter>
<bigtunacan> I forgot you have to you $1, $2 syntax with PG adapter
<FromGitter>
<bigtunacan> @fridgerator I took a look through the changes in the `pg` shard and it doesn't look like it broke from the last time.
<FromGitter>
<bigtunacan> If you put a unique constraint on a field and then run this basic example I created here
<FromGitter>
<bigtunacan> Then `pg` just raises an exception of type `PQ::PQError` and gives a message `duplicate key value violates unique constraint`
Philpax has joined #crystal-lang
<FromGitter>
<fridgerator> In what crystal-pg version do you see that error?
<FromGitter>
<bigtunacan> It's on 0.13.3 which is latest.
<FromGitter>
<bigtunacan> I'm not sure, but I believe it is related to this change in `pg`
<FromGitter>
<bigtunacan> In src/pg.cr it switched how the connection is initialized to prevent a pool from being created.
<FromGitter>
<bigtunacan> Then looking in the Crecto base adapter `def execute(conn, query_string, params)`
<FromGitter>
<bigtunacan> I see that it branches differently `if conn.is_a?(DB::Database)`
<FromGitter>
<bigtunacan> So I'm thinking maybe the change in pg could have switched the path it takes in Crecto?
<FromGitter>
<bigtunacan> But I could be off base here; I've only looked at it for a few hours
<FromGitter>
<fridgerator> the problem can be replicated without crecto
<FromGitter>
<fridgerator> without crecto, I am unable to get that exception if I try and insert a duplicate record
<FromGitter>
<bigtunacan> Do you have a code snippet?
<FromGitter>
<bigtunacan> The reason I couldn't connect is it creates the db using _ characters, but then queries with -
<FromGitter>
<bigtunacan> Once I get past that it hangs, but to me that looks like it is because the code misuses the adapter.
<FromGitter>
<bigtunacan> It is using `query` to try to do an `insert` and then loop over the results.
<FromGitter>
<bigtunacan> But I would think you would be using the `exec` method for inserts.
<FromGitter>
<bigtunacan> If you change it to an `exec` then it runs and raises the duplicate key message
<FromGitter>
<bigtunacan> So; I think it shouldn't hang indefinitely. Should probably timeout or raise some generic invalid query message.
<FromGitter>
<bigtunacan> But it also should not work.
<FromGitter>
<fridgerator> hrmm ok,
<FromGitter>
<fridgerator> It uses `query` because of the `returning *` bit. I don't think `exec` will return anything.
<FromGitter>
<bigtunacan> It won't; exec returns an `ExecResult`
<FromGitter>
<bigtunacan> so there is no result set to iterate
<crystal-gh>
[crystal] jgaskins opened pull request #4601: Pretty-print objects in playground inspector (master...playground-value-formatting) https://git.io/vQUxW
<FromGitter>
<fridgerator> Crecto is utilizing `returning *` so that it has the primary key for newly inserted records without a separate query
<FromGitter>
<fridgerator> hrmmm
<FromGitter>
<bigtunacan> Right; which I assume you need for your Changset?
<FromGitter>
<fridgerator> yeah
<FromGitter>
<bigtunacan> @fridgerator I think it would probably be best to make changes on `crystal-pg` and `Crecto` both
<FromGitter>
<bigtunacan> I'm heading to bed; super tired now.
<FromGitter>
<bigtunacan> I have a partial fix for crystal-pg. I'll keep looking at it from that side.
<FromGitter>
<bigtunacan> @fridgerator I fixed the issue with the pg adapter hanging, but then that's just going to end up raising an exception which you would need to handle in Crecto.
<FromGitter>
<bigtunacan> But that doesn't appear to be the only issue.
<FromGitter>
<bigtunacan> The hanging forever is caused by the pg adapter not handling all of the exceptions it should be so it ends up in a state where it thinks the end of the result set hasn't been reached.
<FromGitter>
<bigtunacan> So... to infinity and beyond...
<FromGitter>
<bigtunacan> But it looks to me like that is just when you try to enumerate a result set which has received an error back.
<FromGitter>
<bigtunacan> You could also do something like this
<FromGitter>
<bigtunacan> db.query "INSERT INTO users(name) VALUES ($1)", "test"
<FromGitter>
<bigtunacan> That can either work...
<FromGitter>
<bigtunacan> or it can silently fail
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter>
<bigtunacan> @akzhan The issue you already opened is related. I'm just working on the pull request for it now so no need for me to comment yet.
<FromGitter>
<bigtunacan> I should have it finished in the next day or two at most.
<FromGitter>
<akzhan> thanks @bigtunacan
<FromGitter>
<sdogruyol> great @bigtunacan
<FromGitter>
<bigtunacan> When I create the pull request I'll be sure to cross reference your issue so you are notified @akzhan
<FromGitter>
<bigtunacan> From there you can also switch to using my fork if you need until it gets merged in.
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter>
<bigtunacan> @azzuwan is DATETIME data type supported?
<FromGitter>
<bigtunacan> If so you can use LEFT() and throw away the timestamp
<FromGitter>
<akzhan> You can add support for custom data type as I suppose. But I’m busy on CLDR support now. ⏎ Btw, draft here - https://github.com/akzhan/crystal-cldr
<FromGitter>
<LuckyChicken91_twitter> what are these #[ and #] meaning?
<RX14>
that was the proposed syntax
<FromGitter>
<LuckyChicken91_twitter> oh this is an idea
<RX14>
yes
<FromGitter>
<LuckyChicken91_twitter> i hoped its real :(
<RX14>
it's a proposal
<FromGitter>
<LuckyChicken91_twitter> and why is crystal not implementing this?!
<RX14>
read the comments
<RX14>
thats why i linked it
<FromGitter>
<LuckyChicken91_twitter> are they really meaning that multiline comments are CONFUSING?
<FromGitter>
<straight-shoota> yes they are
<RX14>
yes for the reasons I said
<FromGitter>
<LuckyChicken91_twitter> this means that ruby is in some things definitely better than crystal
<FromGitter>
<straight-shoota> You can take look at languages that have multiline comments, like Java: `/*` and `*/` mark a multiline comment. Yet, most coding standards require to put ` *` in front of every line in the comment
<FromGitter>
<sdogruyol> not necessarily @LuckyChicken91_twitter
<RX14>
well i'd argue that it's better not to have them
<RX14>
it's a matter of opinion
<RX14>
and of course some languages are going to be ebtter than others at certain tasks
<RX14>
noone ever claimed crystal is better than ruby at everything
<FromGitter>
<LuckyChicken91_twitter> im sure the crystal team is just lazy
<FromGitter>
<straight-shoota> you would consider `=begin` and `=end`as *good*
<RX14>
of course not
<RX14>
that was a PR
<RX14>
they could have clicked one button and had them in the language
<RX14>
but they chose to think and not merge
<RX14>
that's the opposite of lazy
<FromGitter>
<bew> :+1:
<FromGitter>
<sdogruyol> you're not helpful with that words @LuckyChicken91_twitter
<RX14>
i'm very glad we have an opinionated @asterite who keeps the language from being bloated
<FromGitter>
<LuckyChicken91_twitter> wut? they could have clicked one button and had them in the language?! Does this maybe means that crystal is developed with Scratch? or something like this one-click-program-apps
<RX14>
and doesn't just merge features to make people happy
<RX14>
@LuckyChicken91_twitter no what I linked you was a pull request
<RX14>
someone wrote the code for multiline comments
<RX14>
and asked that it be included in crystal
<FromGitter>
<LuckyChicken91_twitter> oohh
<RX14>
and asterite decided not to accept that code
<FromGitter>
<LuckyChicken91_twitter> "someone wrote the code for multiline comments" was this code written in crystal?
<RX14>
yes
<FromGitter>
<bew> yes
<RX14>
you can see the code if you click the view diff button
<RX14>
on the pr i linked
<RX14>
sorry, "files changed"
<FromGitter>
<LuckyChicken91_twitter> this means i can copy the code in crystal!
<FromGitter>
<LuckyChicken91_twitter> and then i have multine lcoomments
<RX14>
and then veryone who uses your code has to compile their own crystal compiler
<RX14>
sure you can if you;re writing code for yourself
<RX14>
but i wouldn't recommend it
<FromGitter>
<LuckyChicken91_twitter> oh
<FromGitter>
<LuckyChicken91_twitter> i need to compile my own crystal compiler?
<FromGitter>
<straight-shoota> yes, the PR contains code for the compiler
<FromGitter>
<straight-shoota> if you want to use it, you need to compile it yourself
<FromGitter>
<LuckyChicken91_twitter> but its crystal code
<FromGitter>
<LuckyChicken91_twitter> crystal code for crystal
<FromGitter>
<straight-shoota> then you can have a compiler which recognizes multiline commends
<FromGitter>
<LuckyChicken91_twitter> oh okay
<RX14>
@LuckyChicken91_twitter the crystal compiler is written in crystal
<FromGitter>
<LuckyChicken91_twitter> ik
<FromGitter>
<bew> so new languages features are added to the compiler in crystal, then the compiler needs to be compiled, and finally you can use the added new languages features in some code, and compile it with the new fresh compiler you just compiled..
<FromGitter>
<LuckyChicken91_twitter> ok i will write my own code
<RX14>
well we only use the last compiler releases features in the compiler so you almost never need a stage2 compiler @bew
<FromGitter>
<straight-shoota> by the way, Ruby technically doesn't have multiline comments either. `=begin`/`=end` designate a documentation block, not a comment.
<FromGitter>
<straight-shoota> and I must say I have never used this
<FromGitter>
<LuckyChicken91_twitter> i dont care. For me its an multiline comment
<FromGitter>
<bew> RX14 true thanks for the clarification
<FromGitter>
<LuckyChicken91_twitter> im bored
<FromGitter>
<LuckyChicken91_twitter> can someone tell me what i should do
<FromGitter>
<straight-shoota> enjoy the nice weather outside ;)
A124 has quit [Ping timeout: 260 seconds]
<FromGitter>
<LuckyChicken91_twitter> what should i do outside
<FromGitter>
<LuckyChicken91_twitter> theres nothing to do
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
Kug3lis is now known as Kug3lis_off
dannyAAM has joined #crystal-lang
A124 has quit [Read error: Connection reset by peer]
A124 has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
onionhammer has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
Raimondi has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
onionhammer has quit [Read error: No route to host]
onionhammer has joined #crystal-lang
onionhammer has quit [Ping timeout: 246 seconds]
hightower2 has quit [Ping timeout: 260 seconds]
<FromGitter>
<drosehn> Sure, the answer is easy, but what was the question?
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
<FromGitter>
<fridgerator> :smile:
onionhammer has joined #crystal-lang
onionhammer1 has joined #crystal-lang
onionhammer has quit [Ping timeout: 255 seconds]
Raimondi has quit [Quit: WeeChat 1.8-dev]
Kug3lis is now known as Kug3lis_off
Raimondi has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter>
<delef> What is exception? ⏎ ⏎ argument 'entry_data_list' of 'GeoIP2::LibMMDB#get_entry_data_list' must be Pointer(Pointer(GeoIP2::LibMMDB::EntryDataListS)), not Poi ⏎ nter(GeoIP2::LibMMDB::EntryDataListS) [https://gitter.im/crystal-lang/crystal?at=594ab4f988348abd0ab55769]
<oprypin>
you need `entry_data_list = uninitialized LibMMDB::EntryDataListS*`
wmoxam_ is now known as wmoxam
wmoxam has quit [Changing host]
wmoxam has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 246 seconds]
onionhammer1 has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 240 seconds]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
onionhammer1 has joined #crystal-lang
<FromGitter>
<akzhan> @straight-shoota no, i haven’t seen twitter-cldr. thanks for the link. anyway my shard is very base like «resources» chapter of twitter-cldr gem. and it is more crystal language driven (no yaml data files, updates for fast llvm compilation etc.)
<FromGitter>
<LuckyChicken91_twitter> somebody know a good crystal framework/gui library
<FromGitter>
<akzhan> by the way, is any PUG parser exists for Crystal?
<FromGitter>
<bew> You meant peg parser?
<FromGitter>
<akzhan> oops yeah :)
<FromGitter>
<bew> No, no usable solution yet
<FromGitter>
<LuckyChicken91_twitter> nobody knows a crystal framework/library?
<FromGitter>
<bew> @akzhan There was Parsh iirc, but the guy stoped the project and used rust instead
<Papierkorb>
only because it's used doesn't make it good. deploying a vuln ridden browser with every application is not a good idea.
gewo has quit [Ping timeout: 268 seconds]
<FromGitter>
<akzhan> It is just for «rapid application development».
<Papierkorb>
not to mention the waste of memory and cpu time. "but computers are getting faster anyway!" and programs are getting slower at the same time, easily outbalancing the higher computing power
<FromGitter>
<straight-shoota> the implementation is weak, but the concept of using web components to build GUIs for native apps is not a bad idea itself.
<FromGitter>
<akzhan> Performance / development cost balance.
<Papierkorb>
Economic factors may be, but that doesn't make it a good program. just a cheap one to create.
<FromGitter>
<akzhan> Yes, of course. Ans VSCode is good catch.
hako__ has joined #crystal-lang
hako_ has quit [Ping timeout: 268 seconds]
sz0 has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
onionhammer1 has quit [Ping timeout: 260 seconds]
Renich_ has quit [Ping timeout: 246 seconds]
onionhammer1 has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 240 seconds]
onionhammer1 has joined #crystal-lang
onionhammer1 has quit [Ping timeout: 240 seconds]
Kug3lis is now known as Kug3lis_off
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
danielpclark has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis_off has quit [Read error: Connection reset by peer]