Any recommended SQL query builders?

Game development with Board Game Arena Studio
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Any recommended SQL query builders?

Post by Tisaac »

tchobello wrote: 10 January 2021, 18:20
Tisaac wrote: 10 January 2021, 16:36
RicardoRix wrote: 10 January 2021, 15:42 I think the real answer is here, just learn SQL, it's not that tricky. As Hornir suggests, it's largely just SELECT, UPDATE.
Probably less tricky than using some else's library. And if you do use a library then it's likely you're still going to need some underlying SQL understanding to use it properly. For example, BGA provide some functions but you will still need to know SQL to know where the limitations might lie.
This is not about learning sql, but about saving time and make stuff more easier to read.
Query builder allow you construct partial queries that you can manipulate as any object and also auto cast when fetching. Really save me a lot of time on my games
well, sorry , but I tend to agree with Ricardo on this...

It's quite impossible, for starters on BGA, to understand what advanced developers have done here...
they are re-writing quite everything, creating their own tools, modules, objects everywhere and so on.
yes, they are saving time, doing it their own way... on each project.

But when I want to read it, it feels like reading 'Choose Your Own Adventure'...

Sometimes, I feel like a dinosaur.
You are missing the fact that query builders exist in many langages, including php. Just look at laravel ORM for instance. So if you are a developper outside of BGA world, it's actually using BGA framework that is difficult. The modules most of us are developping are precisely to get some features similar to what we know from.more classic flows/langages
User avatar
tchobello
Posts: 693
Joined: 18 March 2012, 13:19

Re: Any recommended SQL query builders?

Post by tchobello »

Tisaac wrote: 10 January 2021, 18:55 You are missing the fact that query builders exist in many langages, including php. Just look at laravel ORM for instance. So if you are a developper outside of BGA world, it's actually using BGA framework that is difficult. The modules most of us are developping are precisely to get some features similar to what we know from.more classic flows/langages
that was just a digresssion from someone who has started with assembler 68k. :)
User avatar
mavit
Posts: 36
Joined: 15 September 2016, 20:20

Re: Any recommended SQL query builders?

Post by mavit »

I think itʼs right to be alarmed, nowadays, at the idea of constructing SQL by concatenating strings. Itʼs too easy to get this wrong and leave yourself open to SQL injection. Better to have a library to worry about this so you donʼt have to.

Let us know how you get on, Vikti.
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Any recommended SQL query builders?

Post by Tisaac »

mavit wrote: 11 January 2021, 14:49 I think itʼs right to be alarmed, nowadays, at the idea of constructing SQL by concatenating strings. Itʼs too easy to get this wrong and leave yourself open to SQL injection. Better to have a library to worry about this so you donʼt have to.

Let us know how you get on, Vikti.
You can't really get any SQL injection on BGA if you are doing thing right since you are only asking about int most of the time and checking the params in the actions.php.
And even with my query builder module, I still have to rely to the framework that does not provide prepared queries for instance...
Post Reply

Return to “Developers”