Am following the tag every day and I see this type of questions from time to time, maybe have seen them 20 times or more

The title is always something like this

Convert/Translate (raw) SQL/MySQL query to Eloquent ORM

I assume might be replaced by other ORMs like or in other languages

Here are some examples

Translate Mysql group by date and select count query to laravel eloquent

Convert SQL query to Laravel Query Builder

How to convert SQL query to Laravel Eloquent?

Convert SQL query to Query builder Laravel

I want convert mysql query into laravel orm query

I understand that these questions are different because it's always a different SQL query obviously

But they all show no effort, just paste a block of SQL statement(s) and ask to get it converted for you

There's even an online tool for this, and these questions are highly unlikely to be helpful to anyone else in the future because the title is usually too broad and the SQL is specific to OP's problem

I stumbled upon a user with the gold badge who answered a question of this sort with another SQL statement, I commented that I would close the question as duplicate if I were in their shoes but they disagreed on the latter

Don't know whether am allowed to link to that comment or not

Should I vote to close such questions as duplicates or not?

yes, I already laughed at the possible irony of this question itself being a duplicate

| |
  • Are you also the person going around closing any php question with any php error message in it as duplicate? After all, there is already an answer of how to trouble shoot error messages. – Cerad Nov 6 '19 at 19:46
  • "Don't know whether am allowed to link to that comment" .. I don't think you were not allowed to, but I also don't see the point in doing so, it wouldn't add much. – Tom Nov 6 '19 at 19:48
  • I don't have any tag specific gold badge yet, so no and I would never close a question as duplicate if I didn't find an answer I was going to write already written (if I could that is) – Salim Djerbouh Nov 6 '19 at 19:48
  • 1
    Regarding dupe: It might be useful to create a Q&A where the answer explains in general how to convert SQL to Eloquent and then use that as the dupe target. Using other specific questions with a similar task would be an odd dupe target, imo. – Tom Nov 6 '19 at 19:51
  • @Tom so something like Regex Reference but for converting SQL statements to any? ORM – Salim Djerbouh Nov 6 '19 at 19:53
  • 1
    I don't know these PHP ORM libraries, so I can't tell if they are similar enough to handle several of them without making the Q&A too broad. I would start with the most prominent ORM system and then later adapt the answer (or add other answers) if that fits. – Tom Nov 6 '19 at 20:03
  • 1
    See this answer. Seems to me these are just code translation questions without an attempt and thus off-topic. While we could provide a canonical with general translation advice, that's likely not beneficial since people tend to get mad when their question gets marked as a duplicate that doesn't cover their specific issue – Erik A Nov 6 '19 at 20:06
  • 2
    @ErikA Help Vampires getting mad should not be on the list of concerns when thinking about creating a canonical Q&A. I would first think if there already exists something like this and would it be helpful for people search for stuff like that. – Tom Nov 6 '19 at 20:12
  • I think it can be helpful, the instructions would be almost standard given that OP would know the basics of that ORM – Salim Djerbouh Nov 6 '19 at 20:14
  • 2
    @Tom It isn't just help vampires to worry about, it's the high rep, gold badge wielding enablers that want every question to have a home on Stack Overflow that have a hand in the problem. "It's not a duplicate because it doesn't address this specific SQL statement in this specific context and plus I answered it and am getting upvotes"... – Heretic Monkey Nov 8 '19 at 14:00
  • It happened again today, a gold badger edited the question and upvoted it to 0 after I linked to this meta in a comment, a move I can only interpret as "This question is valid despite it being a code translation service request" – Salim Djerbouh Nov 8 '19 at 14:08
  • @HereticMonkey Well yes, that is also a big problem and maybe even worse, due to the additional moderation rights. – Tom Nov 8 '19 at 14:16
  • 1
    It is just normal for the [sql] tags. [regex] has this problem as well. Core issue is that Google just isn't very helpful when programmers search for solutions. Or duplicates for that matter. If you know a duplicate then just vote it. But you'll burn out after a while, it never stops, then you add these tags to the Ignored Tags section in your profile.. – Hans Passant Nov 8 '19 at 15:29

You must log in to answer this question.

Browse other questions tagged .