The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2017-05-11

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:12 gizmomathboy joined #mojo
00:38 Pierre joined #mojo
00:58 tchaves joined #mojo
01:47 itaipu joined #mojo
01:56 stryx` joined #mojo
02:37 punter joined #mojo
03:06 gryphon joined #mojo
03:09 aborazmeh joined #mojo
03:20 aborazmeh joined #mojo
03:23 dikim_ joined #mojo
03:30 Pierre joined #mojo
03:38 simcop2387 Is there a "sanctioned" way with mojo to grab X-Forwarded-For and make it ->tx->remote_addr?  I see a few plugins that kind of do it and are all 0.01ish, but i wondered if there was anything built in.
03:40 sivoais joined #mojo
03:40 Grinnz simcop2387: set the proxy option in hypnotoad config, or MOJO_REVERSE_PROXY=1
03:41 simcop2387 ah cool.  i figured there had to be a reason the plugins never got touched after a few years ago
03:41 simcop2387 perfect
04:50 Pyritic joined #mojo
05:31 sivoais joined #mojo
05:44 Sebbe joined #mojo
05:46 Lee joined #mojo
05:47 Lee joined #mojo
05:50 inokenty-w joined #mojo
05:50 dod joined #mojo
05:51 Pierre joined #mojo
05:54 dod joined #mojo
05:57 Pierre joined #mojo
06:34 prg joined #mojo
06:57 Pierre joined #mojo
06:58 AndrewIsh joined #mojo
07:02 Sebbe joined #mojo
07:38 trone joined #mojo
08:43 Vandal joined #mojo
08:55 rshadow joined #mojo
09:15 gregf_ joined #mojo
09:43 jlaffaye joined #mojo
09:50 noganex joined #mojo
09:52 Lee joined #mojo
10:22 Bloke joined #mojo
10:23 rshadow1 joined #mojo
10:23 Bloke Can I ask the dispatcher which rule matched? I'm looking for "/view/:id/:mode" when the dispatch was for "/view/1028/admin"
10:28 Xyem Bloke: I think you can get the name of the current route, if that it suitable?
10:28 Xyem $c->current_route == viewidmode /
10:28 Xyem http://mojolicious.org/perldoc/Mojolicious/Plugin/DefaultHelpers#current_route
10:29 itaipu joined #mojo
10:30 Bloke maybe I can use that name to harass the router.
10:35 Eke joined #mojo
10:35 Pierre joined #mojo
11:18 tchaves joined #mojo
12:13 cheako joined #mojo
12:18 Pierre joined #mojo
12:37 bjakubski joined #mojo
12:39 renormalist left #mojo
12:40 gryphon joined #mojo
13:09 gizmomathboy joined #mojo
13:48 Bloke joined #mojo
13:54 Lee joined #mojo
14:08 karjala_ joined #mojo
14:08 karjala_ batman, Mojo::mysql doesn't escape the field names, so I can't use a field name such as "binary"
14:09 karjala_ shouldn't it, though?
14:09 karjala_ that's SQL::Abstract stuff, sorry
14:09 karjala_ not your fault, I understand
14:11 karjala_ solved by using "`binary`" as a fieldname
14:13 sri Mojo::mysql is not as well maintained as ::Pg and ::SQLite sadly
14:14 sri for now i would recommend against using it
14:15 sri configuring SQL::Abstract properly for the database is exactly what those modules are supposed to do
14:18 Grinnz karjala_: setting name_sep => '.', quote_char => '`' on the SQL::Abstract object should fix it
14:20 maschine karjala_, if you have an existing database and want to switch, I just went through the process of converting Mysql to Sqlite.
14:20 maschine https://github.com/dumblob/mysql2sqlite
14:20 Grinnz thats not really a thing to do lightly
14:21 maschine true, but it can be a choice
14:21 Grinnz even as fast as sqlite is there are lots of considerations for using a file-based db instead of a server
14:21 maschine it just depends on what you're using it for
14:21 maschine I didn't look for a way to convert it to PostgreSQL but I'm sure you could
14:31 vicash joined #mojo
14:37 PryMar56 joined #mojo
14:38 itaipu joined #mojo
14:40 coolo joined #mojo
14:45 marty joined #mojo
14:55 karjala_ thanks Grinnz
14:57 karjala_ batman, could you please have Mojo::mysql configure SQL::Abstract properly for use with MySQL? (as sri + Grinnz said, we should set name_sep & quote_char)
14:59 sri i think batman is sick and afk this week
15:02 Grinnz a PR would probably speed up the process
15:40 dikim joined #mojo
15:43 [0xAF] do someone know a good read of advantages of PG over MySQL and in which scenarios it's worth using it? I'm  not familiar with PG and I see most of you prefer PG, so I wonder why. The first few hits in Google are not convincing, at least not for super heavy app with sql procedures probably?
15:44 sri too many advantages to make a list...
15:44 * sri would just never use mysql
15:45 maschine I'm no expert, but doesn't PG follow much more closely to the actual SQL spec?
15:45 sri sane SQL dialect, transactional DDL, native JSON, native arrays, pubsub... and it just goes on
15:46 [0xAF] interesting, it seems I should read more about PG and perhaps try it in some project
15:46 Grinnz i wouldn't say Pg is closer to the SQL spec, as the SQL spec is a little insane itself
15:47 Grinnz but it has a much more intuitive SQL syntax in most cases
15:47 [0xAF] sri, mysql (or mariadb) is implementing json data type in it's final release i believe, though it's not int their stable release, i believe
15:47 sri like how can you even call it a database without transactional DDL
15:47 Grinnz a more cohesive syntax, more flexible queries, etc
15:47 sri the idea that your block of alter tables might fails omewhere in the middle and you end up in an uncertain state is just stupid
15:48 Grinnz also, native arrays make a huge difference.. even emulating them with JSON in sqlite doesn't quite hold up
15:48 sri yea, arrays are awesome
15:49 Grinnz mysql on the other hand is full of bad syntax decisions piled on other bad decisions
15:49 Grinnz it seems as it was developed much like PHP, where whatever some developer needed was hastily patched in
15:50 [0xAF] native arrays sounds cool
15:50 sri and it's not just data types, there is countless functions and operators to make those array and json data types awesome
15:50 Bloke joined #mojo
15:50 Grinnz so it will get the jobs done, but you keep running into strange issues
15:51 [0xAF] hm, it seems i was in a cave for awhile, missed the cool things in DBs :)
15:51 sri in postgres everything feels like it was designed with the big picture in mind
15:51 sri postgres made me like SQL
15:52 Grinnz yeah. clear example: in mysql, to change whether a column is nullable, or change its default, or change its type, you have to redefine the whole column
15:52 Grinnz in postgres, you just change that one property of the column
15:54 [0xAF] hm, you mentioned few things i hate in mysql and after your few given points, i need to read more about PG and perhaps I can switch DBs in the current project (which is still possible)... this could be a good learning experience on PG for me...
15:55 [0xAF] i was half-convinced already actually, seeing many ppl prefer PG over MySQL, so there should be a reason...
15:55 Grinnz the only thing to keep in mind is replication in mysql is much more battle tested. but i hear pg is getting there
15:56 [0xAF] i've read that, but still it's not impossible on PG and on this current project, i do not need replication, fortunate for me :)
15:57 [0xAF] many says the speed for basic reads in mysql is unbeatable... but i guess this is not so important actually...
15:58 [0xAF] sri
15:58 [0xAF] sri, transactional DDL is far from me i guess
15:59 sri transactional DDL means that if you make a typo in a Mojo::Pg migration the whole migration will just get rolled back and you can try again after fixing the typo http://mojolicious.org/perldoc/Mojo/Pg/Migrations
16:00 sri instead of having to manually undo the steps that worked
16:00 [0xAF] lol, that's cool ;) i've been fighting with mysql transactions many times because of typos...
16:01 [0xAF] s/transactions/migrations/
16:01 sri you'll never want to go back once you experience it
16:01 [0xAF] you all convinced me for sure :)
16:16 itaipu joined #mojo
16:16 punter joined #mojo
16:20 dod joined #mojo
16:27 mcsnolte joined #mojo
16:29 dod joined #mojo
16:32 maschine just looking at Mojo:PG and Mojo:SQLite, it seems I could very easily switch to PG
16:33 Grinnz yes, once you install it and set up the service :)
16:33 Grinnz and update all your queries to be compatible
16:34 maschine I've only really just started some test code, so that part would be minimal
16:34 maschine actually, I had PG installed a while back, it shouldn't be tough to get it running again
16:41 maschine jeeze the PG installation is only 10% of the size of MySQL
16:43 dantti_laptop joined #mojo
16:50 dod1 joined #mojo
17:00 cheako joined #mojo
17:06 disputin joined #mojo
17:20 Pyritic joined #mojo
17:48 Trick14 I can't see through the bush anymore, please guide me high level which part of mojo to use ^^
17:49 Trick14 I have around 15 pages I need to crawl, and currently i have one perl script making a ua, loading page one, following some links and dumping the result in a json file.
17:50 Trick14 after first page it loads page 2 and follow some child-links and again dumping into json
17:50 Trick14 how do i get away from doing this 15 times sequentially and use like 4-5 working threads?
17:50 Grinnz start at https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Non-blocking
17:52 Pyritic joined #mojo
17:54 Trick14 thanks
17:54 sri and/or scale the whole thing to multiple cpus/servers with minion
18:11 dod joined #mojo
18:16 howitdo joined #mojo
18:27 sri so, i was wrong about microsoft buying ubuntu, this is way cooler https://blogs.msdn.microsoft.com/commandline/2017/05/11/new-distros-coming-to-bashwsl-via-windows-store/
18:28 genio That's pretty awesome
18:50 Grinnz huh
18:52 pink_mist wow
19:13 kaare joined #mojo
19:23 disputin joined #mojo
19:41 tchaves joined #mojo
19:48 punter joined #mojo
20:20 itaipu joined #mojo
20:27 punter This subclass of SQL::Abstract offers limits: https://metacpan.org/pod/SQL::Abstract::More
20:27 punter and has many ++
20:27 punter Would you suggest I used that for Mojo::mysql|pg|etc ?
20:30 Grinnz punter: you could probably assign that to the abstract attribute, yes; but all your select/insert/delete/update method calls woudl have to use that objects syntax instead
20:30 punter indeed, I would have to rewrite part of the application
20:30 disputin joined #mojo
20:30 punter or at least just a few commands
20:38 rshadow joined #mojo
20:47 Lee joined #mojo
20:54 bwf joined #mojo
20:54 disputin joined #mojo
20:59 disputin joined #mojo
21:01 punter PR submitted to mojo-mysql
21:47 Sebbe joined #mojo
21:49 gryphon joined #mojo
22:01 disputin joined #mojo
22:21 Xyem Is it possible to split a call to a helper across multiple lines in a template?
22:22 cheako joined #mojo
22:22 nic yes
22:22 Xyem Excellent, thanks.
22:24 gizmomathboy joined #mojo
22:32 Xyem I asked because I wasn't able to get it working, but it actually Just Works(TM). Heaven knows what I did the first time..
22:58 disputin joined #mojo
23:38 Lee joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary