Nikita Shilnikov

Results 163 comments of Nikita Shilnikov

> My idea in theory sounds simple: I didn't get it :( How is ```ruby # having this struct class User < ROM::Struct end ``` compatible with ```ruby # this...

There's underscore for placing function arguments when piping. This doesn't work for variant constructors though ``` type foo = | First(int, string); let first = (a, b) => First(a, b);...

@solnic 🤦‍♂ ok I'm still getting invalid results from `.pager.dataset.unlimited.count`, Sequel issues queries for the default dataset which is not expected. I'll take a deeper look

Got it, https://github.com/rom-rb/rom-sql/blob/bde6843526a4f5e2508932e9050e59a55dcf800e/lib/rom/sql/plugin/pagination.rb#L115-L121 It happens because `pager` is eagerly evaluated and passed around with options when you chain relation calls. It means it always sticks to the default dataset. This...

One more thing, `contacts[].values[]`

@solnic sorry for being stupid here, but how is it supposed to work? Remove existing references [in a before hook](https://github.com/rom-rb/rom-sql/blob/2d09761ee07e831dc65ad1a9f17531ebfa9cc2df/lib/rom/sql/plugin/associates.rb#L70-L89)? @mereghost I'd say it should trigger a constraint violation error,...

yes, this should be run inside a transaction, so that possible errors won't pollute the database with partial writes, but this won't prevent from having duplicates anyway, consider this session...

@skinnyjames sure, `bundle exec rubocop` should do

@solnic it has nothing to do with sequel. MySQL does not support returning. The only way to get info about inserted record AFAIK is to call `LAST_INSERT_ID` function wich returns...

@solnic this is not the best we can do, a better option is to fetch inserted record based on provided tuples, ie reload them. Underlying dataset (table or DB view)...