Skip to content

Tag: orm

How to make generic SQL heredocs?

I’m making a mock ORM in Ruby, storing ‘forum’ data. I have the following tables: users (id, fname, lname), and questions (id, title, body, author_id). a_user.create and a_question.create are more or less the same: I’m writing another class, ModelBase, and I’d like to be able to …

Syntax message in sql

I have a problem i don’t realy know how to fix, I took this sql when i exported my database in localhost, but when i try to create the User Table for my site in Production i get this Error message. I thought it was because je ‘Json’ format for the ‘role’ but when i change it to &…

Laravel Eloquent version of “NOT IN” SQL

Just need the Eloquent ORM format of this query.. giving a headache for a while. Answer You Can Try this. First you Can Select all Player IDs. $player_ids = TeamRequest::select(‘player_id’)->get(); Then you can find Players Player::whereNotIn(‘user_id’, $player_ids)->get();