LordSputnik: When we drop the Bookshelf, then we simply replace the `bookshelf(knex(config ))` by `knex(config)`
2018-05-20 14016, 2018
LordSputnik
That's a package-wide issue, not specific to func, so don't worry about it :)
2018-05-20 14034, 2018
bukwurm
LordSputnik: Ok
2018-05-20 14039, 2018
bukwurm
Great
2018-05-20 14000, 2018
LordSputnik
I saw your SQL PR
2018-05-20 14013, 2018
LordSputnik
Looks good to me, just a few comments I added
2018-05-20 14041, 2018
LordSputnik
I also read through the relationship plan properly, and think that you've got the optimal way of doing it there
2018-05-20 14044, 2018
LordSputnik
So am happy with that
2018-05-20 14014, 2018
LordSputnik
(at least, I can't come up with a good alternative, and it seems sensible!)
2018-05-20 14023, 2018
bukwurm
LordSputnik: Ok, great!
2018-05-20 14025, 2018
bukwurm
LordSputnik: One thing I was wondering, now that we are working on the adding function based transactional approach, do I write functions for adding alias and alias_set and everything else, or simply reuse the present bookshelf based approach
2018-05-20 14052, 2018
LordSputnik
bukwurm: I'd say stick with the ORM where other bits of the site use it
2018-05-20 14034, 2018
bukwurm
LordSputnik: Ok, that's a relief, because I was getting worried as it would have been tough.
2018-05-20 14041, 2018
LordSputnik
Adding functions for interacting with the rest of the database is going to be a fair amount of work, and I think that you should focus on the import stuff mostly
2018-05-20 14044, 2018
LordSputnik
Yeah exactly
2018-05-20 14028, 2018
LordSputnik
I'm planning to convert gradually over the course of a few months, so once I have functions I might go in and swap over some of the database access you've written using the ORM, but definitely stick with the ORM to begin with
2018-05-20 14010, 2018
bukwurm
LordSputnik: Ok, I'll need a little bit of your help figuring out how to fit in the ORM based functions though :)
2018-05-20 14020, 2018
LordSputnik
Hmm
2018-05-20 14033, 2018
LordSputnik
You could pass the ORM into the func.init function
2018-05-20 14044, 2018
LordSputnik
And then pass it to whatever functions need it
2018-05-20 14006, 2018
bukwurm
Ok, I'll try that out.
2018-05-20 14028, 2018
LordSputnik
I don't think you'll have any issues mixing knex and bookshelf objects, since the functions in the ORM (e.g. save(), fetch()) will just be calling knex underneath, and you can pass transactions into those functions
2018-05-20 14032, 2018
bukwurm
LordSputnik: I'll might need repositories for the remaining part of the project sometime this week.
2018-05-20 14044, 2018
bukwurm
LordSputnik: Ok
2018-05-20 14007, 2018
LordSputnik
bukwurm: ah yes, sorry bout that
2018-05-20 14010, 2018
LordSputnik
I'll aim to do it tonight
2018-05-20 14040, 2018
LordSputnik
I'm working on some GDPR stuff (account removal) for BookBrainz so I'll do it at the end of that
2018-05-20 14053, 2018
bukwurm
LordSputnik: Ok
2018-05-20 14009, 2018
LordSputnik
bukwurm: learnt any interesting things this week that you'd like to share? :)
2018-05-20 14028, 2018
bukwurm
LordSputnik: Well, I figured out setting up the library and got a bit more comfortable with knex and flow.
2018-05-20 14050, 2018
bukwurm
I did quite a lot of reading on rabbitmq
2018-05-20 14015, 2018
LordSputnik
Good :) Do you think I'm taking the right approach with Immutable records?
2018-05-20 14014, 2018
bukwurm
LordSputnik: Yeah, they're very similar to js objects and so will be perfect for setting up props and other stuff.
2018-05-20 14031, 2018
bukwurm
Plus, default values are a plus.
2018-05-20 14050, 2018
LordSputnik
Good, glad you agree, I was a bit unsure at first but I think I'm convinced now
2018-05-20 14003, 2018
LordSputnik
Is rabbitmq simple?
2018-05-20 14031, 2018
bukwurm
LordSputnik: Yeah it's not that difficult I guess.
2018-05-20 14049, 2018
LordSputnik
I don't think I've used it before
2018-05-20 14057, 2018
bukwurm
The armq.node library is quite straightforward.
2018-05-20 14057, 2018
LordSputnik
Although I have used similar things
2018-05-20 14017, 2018
bukwurm
But I'm still reading it, so can't be sure right now.
2018-05-20 14020, 2018
bukwurm
LordSputnik: Ok
2018-05-20 14043, 2018
LordSputnik
I might try setting it up on the BookBrainz server next week
2018-05-20 14049, 2018
bukwurm
LordSputnik: I found bookshelf very non-intuitive, so it's easier compared to that. :)
2018-05-20 14009, 2018
bukwurm
LordSputnik: Similar like kafka?
2018-05-20 14027, 2018
LordSputnik
I think SQLAlchemy in Python is much nicer than bookshelf in JS
2018-05-20 14044, 2018
bukwurm
LordSputnik: +1
2018-05-20 14007, 2018
bukwurm
LordSputnik: I have been reading around regarding choice of ORM for node
2018-05-20 14014, 2018
LordSputnik
bukwurm: can't remember exactly what it was I used, but it was in an IoT system - edge nodes sent messages to the central server
2018-05-20 14029, 2018
bukwurm
And Objection.js has a good reputation.
2018-05-20 14046, 2018
bukwurm
LordSputnik: Ok. I used a similar thing in ROS project.
2018-05-20 14053, 2018
LordSputnik
It probably didn't exist when we picked bookshelf about 4 years ago!
2018-05-20 14014, 2018
bukwurm
LordSputnik: Exactly what I thought when I saw Objection
2018-05-20 14017, 2018
bukwurm
:)
2018-05-20 14036, 2018
LordSputnik
I'm pretty sure that moving away from an ORM and towards functions is the right thing though
2018-05-20 14059, 2018
bukwurm
LordSputnik: Me too. ORMs have some pretty tough restrictions.
2018-05-20 14013, 2018
LordSputnik
bukwurm: any challenges you can see coming up over the next week?
2018-05-20 14044, 2018
bukwurm
LordSputnik: I am terribly behind schedule, so that's the biggest problem right now. 😓
2018-05-20 14002, 2018
bukwurm
All this work had to be completed by today.
2018-05-20 14016, 2018
bukwurm
Still, I'll try to catch up this week.
2018-05-20 14018, 2018
bukwurm
LordSputnik: Another request I have is could you please add nodemon as a dependency
2018-05-20 14028, 2018
bukwurm
in the bb-data ?
2018-05-20 14018, 2018
bukwurm
Also, flow and flow-bin are missing as dependencies.
2018-05-20 14007, 2018
LordSputnik
bukwurm: I think as long as you can get the first package of work done by the end of next week, and started on the producer application, you'll be on track
2018-05-20 14013, 2018
bukwurm
LordSputnik: It'll be great to have nodemon run prepublish silently in the background and not having to do it manually every time.
2018-05-20 14040, 2018
bukwurm
LordSputnik: Yeah, I am thinking of the same. :)
2018-05-20 14059, 2018
bukwurm
LordSputnik: One more important thing I almost misssed
2018-05-20 14021, 2018
bukwurm
knex takes in regular js objects
2018-05-20 14042, 2018
bukwurm
as parameters, and none of Immutable.js objects
2018-05-20 14051, 2018
LordSputnik
bukwurm: should be able to do a PR for that - essentially just update package.json to have all the dependencies you want to commit, then delete node_modules and the package lock file, then "npm install", then commit the package and lock JSON files
2018-05-20 14058, 2018
LordSputnik
(the dependencies)
2018-05-20 14021, 2018
bukwurm
LordSputnik: I'd do it, but will it be ok to mess up the lock file?
2018-05-20 14041, 2018
LordSputnik
bukwurm: it should just update some of the locked packages
2018-05-20 14005, 2018
bukwurm
LordSputnik: npm behaves weird in this regard
2018-05-20 14015, 2018
bukwurm
I don't know if you remember
2018-05-20 14019, 2018
LordSputnik
Essentially we're mainly using them to ensure that the version tested by CI and the versions we deploy in production are the same
2018-05-20 14031, 2018
bukwurm
But couple of months ago I brought it up here
2018-05-20 14049, 2018
bukwurm
If I simply clone the bb-site repo and run npm install
2018-05-20 14052, 2018
LordSputnik
Yeah, it's not great. But if you delete node_modules and package-lock.json before doing npm install, I've found it generally works ok
2018-05-20 14055, 2018
bukwurm
It changes the lock file!
2018-05-20 14017, 2018
LordSputnik
Yeah, it's probably silently updating the package versions when a new minor version has been released
2018-05-20 14052, 2018
bukwurm
LordSputnik: But it means it'll tamper with git and everything, and I'll have to ignore it.
2018-05-20 14007, 2018
LordSputnik
It's OK to change the lock file :)
2018-05-20 14017, 2018
bukwurm
Also, I read some issue where it adds system specific dependencies
2018-05-20 14034, 2018
bukwurm
Like in mac systems it adds fs-events or something
2018-05-20 14057, 2018
LordSputnik
Alternatively you can just update package.json in the PR, then I can make another commit afterwards updating the locked packages
2018-05-20 14057, 2018
bukwurm
LordSputnik: Anyhow, I'll try it
2018-05-20 14023, 2018
bukwurm
Let's see if it makes some weird changes.
2018-05-20 14036, 2018
bukwurm
LordSputnik: Ok, that's work for me. :)
2018-05-20 14040, 2018
bukwurm
*that'll
2018-05-20 14055, 2018
LordSputnik
Back to the knex stuff?
2018-05-20 14059, 2018
bukwurm
LordSputnik: knex takes in regular js objects as parameters, and none of Immutable.js objects
2018-05-20 14005, 2018
bukwurm
LordSputnik: Yeah
2018-05-20 14022, 2018
bukwurm
So there are two choices
2018-05-20 14045, 2018
bukwurm
Either we pass simple js objects to all bb-data function, but they return Immutable objects
2018-05-20 14053, 2018
samj1912
It would be nice if BB could move to yarn instead of npm (shouldn't take much time to port)
2018-05-20 14003, 2018
LordSputnik
samj1912: tried that, it worked worse than npm
2018-05-20 14011, 2018
samj1912
How so?
2018-05-20 14018, 2018
samj1912
And when?
2018-05-20 14019, 2018
bukwurm
Or we pass Immutable objects which are then converted to simple js objects
2018-05-20 14048, 2018
bukwurm
Used in the query and then returned back as Immutable objects