New around here? Register your SA Forums Account here!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

TheFluff posted:

it really is, but people just don't seem to get it for some reason. i saw some dumbass complaining on twitter the other day that they were disappointed there was no ~innovation~ in database query languages so here we are with 1970's sql, ugh :rolleyes:

like, have you maybe considered that the reason it's so ubiquitous is that it loving works, you goddamned nerdlord?

it's also just plain wrong in that modern relational databases support a hell of a lot beyond the core relational algebra stuff that sql started with

Adbot
ADBOT LOVES YOU

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.



Soricidus posted:

nice data normalization for a forum where usernames are mutable, comrade two-hander ... or should i say radium?

there's probably a jira for "my good posts have been lost after I changed my username" marked as closed:wontfix

that's what I tell myself and not that I just haven't made any :negative:

Powerful Two-Hander
Mar 9, 2004

Mods please change my name to "Tooter Skeleton" TIA.



TheFluff posted:

it really is, but people just don't seem to get it for some reason. i saw some dumbass complaining on twitter the other day that they were disappointed there was no ~innovation~ in database query languages so here we are with 1970's sql, ugh :rolleyes:

like, have you maybe considered that the reason it's so ubiquitous is that it loving works, you goddamned nerdlord?

wasn't there some thing like "nosql databases are for idiot Web programmers learning why everyone else uses sql"?

I mean, one guy I know was storing time series pricing data as an array on an object in mongo and was complaining he was having problems with the data volume and it was like, that's because that's stupid, just use a table.

Progressive JPEG posted:

it's only shameful if your figgies have not also substantially increased along the way

tbf they have and I get to do poo poo that I wouldn't have otherwise so it's actually worked out ok so far. also thanks to this stupid dead forum I can readily argue with all my peers about their inferior technology choices, thus proving that I'm "Senior" .

HoboMan
Nov 4, 2010

Powerful Two-Hander posted:

I mean, one guy I know was storing time series pricing data as an array on an object in mongo and was complaining he was having problems with the data volume and it was like, that's because that's stupid, just use a table.

lol, like even if you're committed to not using sql there are time series databases

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

Powerful Two-Hander posted:

there's probably a jira for "my good posts have been lost after I changed my username" marked as closed:wontfix

that's what I tell myself and not that I just haven't made any :negative:

i still lol every time i see my old threads in the bookmarks with my old username, i just lol at them and at radium.

redleader
Aug 18, 2005

Engage according to operational parameters

Aramoro posted:

So now I have to rewrite how we build the tree in the first place so we add the nodes in the right order. Or build the tree as we are and go back over it at the end resorting all the nodes based on the edges. This tree is critical to all of our apps. Our business analysts are really pushing for this change based on the fact its just changing one sort order for another, surely a half hour change no problem. Our testers on the other hand are saying its days of test effort to do the regression on the change as its such a key part of the system.

My problem are business analysts.

put a month+ estimate on it and tell then you justify the amount of time you'll need to spend on it

i'm assuming it will take less than a month. if not, round up generously

Bloody
Mar 3, 2013

take your initial estimate, double the number, and increment the unit. for example:
2 days -> 4 weeks
a month -> 2 years

redleader
Aug 18, 2005

Engage according to operational parameters
i agree with pretty much all the sql criticism in this article (although some people are really offended by the existence of NULL). i'd also add another problem: the absurd lack of consistency between rdbmses

but like, sql's fine. it's not great, it kinda sucks, but it's actually fine. basically,

akadajet posted:

it's the cause of, and the solution to all of our problems

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
man those guys really chose some inconsequential poo poo to focus on

i mean they're right on every point - yes sql is annoying to write manually and it has too much syntax and it's inconsistent as gently caress and null is for barbarians and yes scalar expressions are dumb - but who loving cares? absolutely none of those issues are why people don't want to learn sql - they're all problems that only sql turbonerds care about. people in general don't want to learn sql because they don't understand how sets work. it takes time, effort and practice to really understand the join types (or at least it did for me). it's different from what people are used to so they don't bother. you can't fix this with something that has slightly more consistent syntax and requires slightly less typing.

they do sorta touch on one important problem though and that's composability (and reusability). you can sorta do some of this with views, but although they have a lot of uses, they are sorta limited in what you can do, and a lot of people don't really deploy code to their database like that but instead rely on generating queries in some other environment. there are some good tools for that these days but people seem to insist on inventing bad simplified variants and copying mongodb's loving json query syntax instead???

TheFluff fucked around with this message at 00:54 on May 12, 2019

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
it's like they looked at c and figured the problem with the language was that understanding what the hell the const keyword actually does in any given position is way too hard - it's absolutely true, but the issues go far deeper than that

Carthag Tuek
Oct 15, 2005

altid pamo når du går
veje du burd' kende
overleved' barneår
lig' til livets ende

void its(const *problem) :dadjoke:

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE
like, i know many people who really genuinely think sql is hard and they have a really hard time wrapping their heads around it. and i'm absolutely not surprised, i did as well for a long time. i don't think that's sql's fault really, it's just that we're not used to thinking in the way sql does

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

mystes posted:

Doing a dfs or fold or whatever on a rose tree is hardly an unsolved problem in computer science, but 30 minutes is pretty short to make changes to implement and properly test this in your application.

I don't think I've ever heard the term "rose tree", I thought those were called just trees?

ThePeavstenator
Dec 18, 2012

:burger::burger::burger::burger::burger:

Establish the Buns

:burger::burger::burger::burger::burger:

akadajet posted:

it’s eventually consistently funny

mystes
May 31, 2006

Symbolic Butt posted:

I don't think I've ever heard the term "rose tree", I thought those were called just trees?
Now that I think about it, for some reason the term appears to be common in the Haskell community for some reason but otherwise almost never used.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

TheFluff posted:

it really is, but people just don't seem to get it for some reason. i saw some dumbass complaining on twitter the other day that they were disappointed there was no ~innovation~ in database query languages so here we are with 1970's sql, ugh :rolleyes:

like, have you maybe considered that the reason it's so ubiquitous is that it loving works, you goddamned nerdlord?

don’t you know that if you can’t see something change, then it didn’t change?

if an OS didn’t get a facelift, then nothing under the hood changed

if a language didn’t get new syntax, none of the implementation changed

brap
Aug 23, 2004

Grimey Drawer
tbh what bugs me about sql is that i have never seen it be well-tooled. microsoft SSMS can give some column completion lists and stuff but if your query is hosed up quite often the editor will just say "there's a problem around $some_token". it feels like all the engineering effort goes into making the queries run fast and new ways to shart and index your database and whatnot, but not into developer productivity.

perhaps some vendor out there has done it and I just don't know.

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.

brap posted:

tbh what bugs me about sql is that i have never seen it be well-tooled. microsoft SSMS can give some column completion lists and stuff but if your query is hosed up quite often the editor will just say "there's a problem around $some_token". it feels like all the engineering effort goes into making the queries run fast and new ways to shart and index your database and whatnot, but not into developer productivity.

the t-sql parsers (yes, plural) are old and unloved. there is engineering effort in tools for mssql but it's primarily in building out new cross-platform tools.

HoboMan
Nov 4, 2010

redgate tools for smss i found quite needs suiting. they were slightly jank but far better than anything else i've seen (which is admittedly not much)

gave good code completion on par with an ide and had version control and db object diff that i liked using more than the very lovely visual studio sql project way to do it

floatman
Mar 17, 2009

Plorkyeran posted:

i want to live in a world where people just use sql rather than complaining endlessly about it and building impossibly awful things just to avoid having to learn sql

I already live in a world where people just use SQL building impossibly awful things just to avoid having to learn SQL.

Fiedler
Jun 29, 2002

I, for one, welcome our new mouse overlords.
the database projects are fine, but require you to use visual studio for database editing. people get really comfortable doing all database related stuff in ssms, so redgate feels nicer.

floatman
Mar 17, 2009
The people that made this project, them loves em some SQL. In fact, they love it so much we have an ancient MVC framework which does not have models. Every class that has "model" in its class name is not a model in it's normal sense (i.e. a collection of data that represents some domain poo poo) but is actually a representation of a database table.
So what this means is you got poo poo like a user "model", but what you're actually doing is poo poo like
PHP code:

$sql = 'select * from users join bookings on bookings.userID = users.id';
$users = $userModel->fetch($sql);
echo('User had booking' . $users->bookingName);

Anyway what I recently found out is that there's a class for sending emails. How does this class for sending emails work? You provided it with an email template ID, and OBJECT TYPE ID, and then an OBJECT ID as arguments.
How does it work then? Note how there's no mentioned of to address or whatever. Here's how it works:

PHP code:

$emailer = new mailer();
$mailer->mail($templateID, 1, 200);
The 1 is the object type ID. There is an "object type" table that basically lists the tables in the database, and their corresponding "model" classes. So in this case, 1 refers to the user table, and 200 means a user table primary key of 200.
The mailer class uses dynamic class loading via strings stored in the database fuckery to create a new userModel class, then calls $class->getUserEmail(200) on the object. This then loads the email address of the user from the user table.
For horrifying reasons I will not elaborate on here, the function is called with various values for object type ID. So let's say I have to call ->mail() using the booking table. I will call $mailer->mail($templateID, 2, 99). The mailer class will then build a bookingModel class, then call getUserEmail(99) on that class, and will promptly fail because gently caress you you forgot to implement the getUserFunction() on the bookingModel class to SENSIBLY return the user email related to a booking.
I say sensibly return because sometime ago some genius decided to take the implementation of userModel->getEmail() and move that into the model abstract class that all models implement, therefore "fixing" all unknown method errors and replacing them with hidden trash runtime SQL errors.
This also has the hilarious effect of confusing our ide because you can call for a user email on every database table, including the table where we store colours.

Like dude, you can call colourTable->getUserEmail () because it makes sense that a colour can belong to a user in the system(????????)

gonadic io
Feb 16, 2011

>>=
Speaking of SQL I am deeply unsatisfied with https://github.com/djmcgill/dominions-5-status/blob/master/src/db/mod.rs

Anybody want to suggest a better way that doesn't involve going ormy with diesel?

Xarn
Jun 26, 2015

TheFluff posted:

like, i know many people who really genuinely think sql is hard and they have a really hard time wrapping their heads around it. and i'm absolutely not surprised, i did as well for a long time. i don't think that's sql's fault really, it's just that we're not used to thinking in the way sql does

:shrug: Sets are easy, describing them using the SQL rear end-backwards syntax that is randomly (in)compatible and (un)performant between different underlying DBs is PITA.

champagne posting
Apr 5, 2006

YOU ARE A BRAIN
IN A BUNKER


Xarn posted:

:shrug: Sets are easy, describing them using the SQL rear end-backwards syntax that is randomly (in)compatible and (un)performant between different underlying DBs is PITA.

imagine if there were only one sql and it ran beautifully on every platform

but also it’s owned by oracle

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

floatman posted:

The people that made this project, them loves em some SQL. In fact, they love it so much

quote:

Anyway what I recently found out is that there's a class for sending emails. How does this class for sending emails work?

don't let them know about https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-send-dbmail-transact-sql

floatman
Mar 17, 2009
Yesssssssss.

Is there anything that MSSQL doesn't do?

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
the worst thing about sql is "select column1, column2, column3 from table" instead of "from table select column1, column2, column3", because when i'm typing the columns my ide's autocompletion features are less useful.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Wheany posted:

the worst thing about sql is "select column1, column2, column3 from table" instead of "from table select column1, column2, column3", because when i'm typing the columns my ide's autocompletion features are less useful.

agreed

lovely workaround: type 'from table foo' first, then press home or ctrl-leftarrow and type the selects. most ides should provide autocomplete. lovely workaround 2: write 'select foo.column1 from foo' instead

this sort of thing why i think theFluff was actually agreeing with the edgedb guys more than he thinks:

quote:

man those guys really chose some inconsequential poo poo to focus on

i mean they're right on every point - yes sql is annoying to write manually and it has too much syntax and it's inconsistent as gently caress and null is for barbarians and yes scalar expressions are dumb - but who loving cares? absolutely none of those issues are why people don't want to learn sql - they're all problems that only sql turbonerds care about. people in general don't want to learn sql because they don't understand how sets work.

sql is great because the underlying concepts and theories are crystal clear and work. yes they're completely different from the imperative stuff that is taught in Programming 101 courses, which is why they take a while to learn. but once the _idea_ clicks, you can make sense of anything in the language. an extremely complex query may give you a headache but it will never leave you completely lost, you can always trivially decompose it into grokkable parts

meanwhile, the sql frontend / syntax is about 80-90% of where it should be. stuff like the messy order of statements, the dual use of NULL, the type coercion, the clunky composition tools, are all little annoyances that aren't gonna stop anybody who understands sql from being productive, but any new sql frontend should fix them nevertheless.

i don't agree with the edgedb guys on some of their choices (autoflattening sets in particular looks very suspicious), but focusing on 'inconsequential poo poo' is exactly the right thing to do if one wants to improve sql even further

shaggar bait: if sql is 80-90% there, i would say linq is about 98-99% there

suffix
Jul 27, 2013

Wheeee!
actually the worst thing about sql is "delete from table"

the second thing is their cobol syndrome (OFFSET start { ROW | ROWS } FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY)
and the third probably something something sql injection

Bloody
Mar 3, 2013

linq to sql is a cool idea like imagine if sql databases were actually that easy to work with

Bloody
Mar 3, 2013

linq is like sql 2.0

TheFluff
Dec 13, 2006

FRIENDS, LISTEN TO ME
I AM A SEAGULL
OF WEALTH AND TASTE

NihilCredo posted:

agreed

lovely workaround: type 'from table foo' first, then press home or ctrl-leftarrow and type the selects. most ides should provide autocomplete. lovely workaround 2: write 'select foo.column1 from foo' instead

this sort of thing why i think theFluff was actually agreeing with the edgedb guys more than he thinks:


sql is great because the underlying concepts and theories are crystal clear and work. yes they're completely different from the imperative stuff that is taught in Programming 101 courses, which is why they take a while to learn. but once the _idea_ clicks, you can make sense of anything in the language. an extremely complex query may give you a headache but it will never leave you completely lost, you can always trivially decompose it into grokkable parts

meanwhile, the sql frontend / syntax is about 80-90% of where it should be. stuff like the messy order of statements, the dual use of NULL, the type coercion, the clunky composition tools, are all little annoyances that aren't gonna stop anybody who understands sql from being productive, but any new sql frontend should fix them nevertheless.

i don't agree with the edgedb guys on some of their choices (autoflattening sets in particular looks very suspicious), but focusing on 'inconsequential poo poo' is exactly the right thing to do if one wants to improve sql even further

shaggar bait: if sql is 80-90% there, i would say linq is about 98-99% there

i absolutely agree with your description of why sql is good. I see what you mean too and that's a fair point tbh. I guess I was dreaming about some magical language that would make it easier for me to make junior devs not scared of sql

TheFluff fucked around with this message at 15:42 on May 12, 2019

dick traceroute
Feb 24, 2010

Open the pod bay doors, Hal.
Grimey Drawer

TheFluff posted:

i absolutely agree with your description of why sql is good. I see what you mean too and that's a fair point tbh. I guess I was dreaming about some magical language that would make it easier for me to make junior devs not scared of sql

I knew a senior dev scared of SQL
Thankfully past tense

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
there's a shitload of room for a better sql that fixes all the minor annoyances in sql and results in overall a much more pleasant experience for people who use sql, as while they're minor individually there's so many of them that they really do add up

i just agree with the notion that those annoyances aren't why the people who refuse to just learn sql aren't using it.

Shaggar
Apr 26, 2006

NihilCredo posted:

agreed

lovely workaround: type 'from table foo' first, then press home or ctrl-leftarrow and type the selects. most ides should provide autocomplete. lovely workaround 2: write 'select foo.column1 from foo' instead

this sort of thing why i think theFluff was actually agreeing with the edgedb guys more than he thinks:


sql is great because the underlying concepts and theories are crystal clear and work. yes they're completely different from the imperative stuff that is taught in Programming 101 courses, which is why they take a while to learn. but once the _idea_ clicks, you can make sense of anything in the language. an extremely complex query may give you a headache but it will never leave you completely lost, you can always trivially decompose it into grokkable parts

meanwhile, the sql frontend / syntax is about 80-90% of where it should be. stuff like the messy order of statements, the dual use of NULL, the type coercion, the clunky composition tools, are all little annoyances that aren't gonna stop anybody who understands sql from being productive, but any new sql frontend should fix them nevertheless.

i don't agree with the edgedb guys on some of their choices (autoflattening sets in particular looks very suspicious), but focusing on 'inconsequential poo poo' is exactly the right thing to do if one wants to improve sql even further

shaggar bait: if sql is 80-90% there, i would say linq is about 98-99% there

linq is good and sql is good. linq2sql is extremely slow and no good

mystes
May 31, 2006

How about linq query syntax?

gonadic io
Feb 16, 2011

>>=
linq and sql might have similar syntax but they could not be more different other than that

Shaggar
Apr 26, 2006

mystes posted:

How about linq query syntax?

I don't really use it but it makes sense to anyone whos ever used sql.

Adbot
ADBOT LOVES YOU

HoboMan
Nov 4, 2010

Fiedler posted:

the database projects are fine, but require you to use visual studio for database editing. people get really comfortable doing all database related stuff in ssms, so redgate feels nicer.

visual studio's code completion for sql is garage to non-existent and trying to sync up a sql project to the database has never not broken both the database and the project

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply