Forums  /  The Site  /  Ability to write custom SQL queries
  diggitydingdongdiggitydingdong

Dunno how it would work, but instead of having all these separate options for things you could have a text field that allows you to write SQL code (or some dumbed-down version of it) so we can organise and sort the boards more to our will better. Can think of a few situations where this would be useful.

I dunno how secure it would be, but whatever works works, right?

 
  TimmiluvsTimmiluvs

Can you say “SQL Injection”? (Although technically it wouldn’t even be that since you’d give the users raw access lmao)

This feature is a massive no-no for security on any site. You never give your users direct access to your DB. The second you give people access to do that, hundreds of requests will start pouring in attempting to drop every table. Even with sanitizing the inputs it would be a nightmare and someone would succeed relatively quickly.

What you just described is comically insecure.

NokiDokiNokiDoki, HowDenKingHowDenKing and ShikenNuggetsShikenNuggets like this. 
  VolvagiaVolvagia

Absolutely not, sorry. A user will never have SQL access unless it's through an exploit (which should be reported and patched if one exists).

You've made three threads of this also. I'm aware there's a bug with holding "Post" and submitting a request to the site, that I'll be looking into (idk why it exists yet)... so I'll assume you did it by mistake.

@diggitydingdong if you're looking for a way to sort the boards - please describe what you mean in detail and it'll be discussed.

HowDenKingHowDenKing, ShikenNuggetsShikenNuggets and paintophobiapaintophobia like this. 
  diggitydingdongdiggitydingdong

Fair enough, I'm not too involved with that stuff, thought I'd give it a shot.

Let's say in a game, the in game time gives you a time in seconds. So when you submit a run for the game, you submit that IGT. There's also an option to submit RTA. What I want the sorting to be is to sort the players by in game time, and then by RTA. If someone doesnt submit RTA, they dont get pushed to the bottom though. Something like this:

th | RTA | IGT
----+-------+-----
1st | 38.3 | 38
2nd | 38.4 | 38
3rd | 38.7 | 38
4th | N/A | 38
4th | N/A | 38
6th | 39.1 | 39
7th | 39.3 | 39
8th | 39.7 | 39
9th | N/A | 39
9th | N/A | 39
11th | 40.1 | 40

and etc. Is something like that possible?

 
  LivLiv

Can't you just set in-game time as the default timing method?

This is the last game you ran:

https://www.speedrun.com/A_Platformer_for_Ants

Isn't that the setup you're wanting? I don't think both can be sorted because that isn't really possible, one or the other has to take priority.

 
  diggitydingdongdiggitydingdong

it would show the top 5 people as shared 1st'

edit: and that's not particularly desirable

 
  HabrenoHabreno

That's because as far as the comparison goes, they are tied for 1st. With a 38.

 
  diggitydingdongdiggitydingdong

exactly, which is why i wanted more in depth sorting capabilities, at least

doesnt have to be straight SQL, which yeah would be a bad idea

 
  TimmiluvsTimmiluvs

I don’t understand what you’re trying to accomplish. What you’re describing makes very little sense.

Your example above shows proper sorting by RTA time - where the fastest RTA is first despite the IGT all being the same. But then you say you don’t want to bump those who only submit IGT to the bottom. But you have to do that, you can’t have it both ways. If RTA is priority and someone doesn’t submit RTA, then they won’t be sorted properly.

With your example, it wouldn’t make sense for anyone to ever submit RTA. Everyone would/should submit only IGT because that would tie everyone for 1st instead of doing this weird double comparison that won’t make sense and result in people getting weird positions on the LB. If anything, what you’re describing would result in inaccurate rankings sine you’re essentially using two completely independent ways of ranking times.

 
  NovaeuNovaeu

They are in order, but they qualify as tied for first due to IGT, but are sorted by RTA, despite being tied for first.
But I can see why that may be a bit offsetting, as it has a lot of repeating numbers and stuff.
(Also what I think it looks like?)

1st | 47.560 RTA | 47 IGT
2nd | 47.680 RTA | 47 IGT
etc, sorry if this isn't what you're thinking of.

Edit: Its not meant to be confusing, its just separating the leaderboards more evenly

diggitydingdongdiggitydingdong likes this. 
  diggitydingdongdiggitydingdong

It would be the same as if every one that didnt submit RTA instead put their IGT time but with 999 milliseconds. If that makes sense. The game has accurate IGT timing and no load screens, so it would make sense that way.

 
  PresJPolkPresJPolk

Letting a user submit SQL would be terribad.

But creating an intermediate query interface would be viable. I implemented that at work for our API.