Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

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.
 
  • Locked thread
aardvaard
Mar 4, 2013

you belong in the bog of eternal stench

https://twitter.com/charliesome/status/799753287448686594

Adbot
ADBOT LOVES YOU

Powerful Two-Hander
Mar 10, 2004

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


i am pretty sure that the garbage tier procedures i keep finding lurking around are due to someonw using an entity framework style wrapper because they didn't understand sql. there's no way a sane person could have formatted statements like that anyway.

also just write a wrapper for your procs its not that hard and you wont curse the next person with having to figure out what the gently caress entity framework is actually doing through some bullshit edmx file

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Powerful Two-Hander posted:

i am pretty sure that the garbage tier procedures i keep finding lurking around are due to someonw using an entity framework style wrapper because they didn't understand sql. there's no way a sane person could have formatted statements like that anyway.

also just write a wrapper for your procs its not that hard and you wont curse the next person with having to figure out what the gently caress entity framework is actually doing through some bullshit edmx file

yeah i haven't really decided how i feel about EF in the long run

It was nice for this application, since code (outside of the stuff generated by the edmx) is like 500 lines total and it's nearly a one-off so quick and dirty is the name of the game

but i've definitely run into a lot of idiosyncracies (being unable to make the data classes internal without breaking everything, among others) that make me leery of wanting to use it again in a larger project

THEN AGAIN manually writing data classes for like 20 tables with some two dozen columns in some of them can eat forty bags of hell

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


I've been in ancient c++ land for so long that i'm really not au fait with modern practices or even capabilities in other languages or frameworks anymore

Powerful Two-Hander
Mar 10, 2004

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


like i feel like im being some kind of old man shouting at kids to get off his lawn or whatever but seriously, why do people keep coming up with ever more convoluted ways to avoid having to write sql?

edit: yeah mapping is tedious but there are frameworks to automate that. every EF implementation ive seen has been 'fine' until it reaches a point where suddenly it's not and you're hosed because you're now locked in to it and so you have to hide logic in the db functions which defeats the original point.

also i have probably only seen "bad" implementations!

Powerful Two-Hander fucked around with this message at 01:59 on Nov 19, 2016

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


My understanding learning this poo poo was that LINQ to database is essentially the task EF was made for (formerly LINQ to SQL but I guess that only really worked with SQL Server???) and, well, I really like LINQ :shobon:

HoboMan
Nov 4, 2010

linq is cool a gently caress since filter, map, and fold are cool as gently caress, but what it got to do with sql?

tef
May 30, 2004

-> some l-system crap ->
computers are bad

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

HoboMan posted:

linq is cool a gently caress since filter, map, and fold are cool as gently caress, but what it got to do with sql?

i mean, there's a reason that LINQ uses the same names as SQL keywords, and it's not just coincidence

Mao Zedong Thot
Oct 16, 2008


tef posted:

computers are bad

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


computers are.... good...???????

HoboMan
Nov 4, 2010

tef posted:

computers are bad

jony neuemonic
Nov 13, 2009

Ciaphas posted:

computers are.... good...???????

nah.

Bloody
Mar 3, 2013

tef posted:

computers are bad

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





linq is cool but people should learn sql prob if they deal with databases. you have to learn 90% of it to use a lovely query generator anyways, may as well learn the last 10% and not rely on weird magic

jony neuemonic
Nov 13, 2009

yeah, even if you're going to use an orm sql skills are never going to hurt you.

besides, you're eventually going to need them when that orm does something stupid.

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


oh for sure i know enough sql to get by

plaartly this assignment was a chance to learn some new to me tech (EF), tho i have no good sense of when to use something like it as opposed to going straight for Oracle.DataAccess or w/e

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


ps gently caress OCI and OCCI in their respective assholes

Shaggar
Apr 26, 2006

Ciaphas posted:

better than writing raw sql

though this is my first foray into EF so i really don't have a fukken clue what i'm doing

use dapper. also: use stored procs

Shaggar
Apr 26, 2006
entity framework is bad even for an orm.

jony neuemonic
Nov 13, 2009

Shaggar posted:

use dapper. also: use stored procs

is using identity without ef as much of a pain as i suspect it is?

Shaggar
Apr 26, 2006
I don't think so. you have to write your own stores, but they're easier than you think and you don't really need to implement everything. you should also consider using federation/claims based auth instead of database auth. adfs and azure ad are both free and take the boring, hard to do right stuff out of your hands

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

WHAT NOW shagger

jony neuemonic
Nov 13, 2009

hell, i don't have anything better planned tomorrow. time to poke around in identity's guts.

Shaggar
Apr 26, 2006

finally you can get a working db on Linux. that said idk if theres a market of people who cant afford a windows license but can afford sql server.

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


Shaggar posted:

use dapper. also: use stored procs

dapper looks neat, thanks, i'll gently caress around with it over the weekend

probably won't be able to use it any time soon at work because NEW SOFTWARE SUBMIT DOCUMENTATIONK HA$TLEKBSDKJCGVB

Shaggar
Apr 26, 2006
either way you should use stored procs. leave the sql to sqlserver

Mao Zedong Thot
Oct 16, 2008


Shaggar posted:

finally you can get a working db on Linux. that said idk if theres a market of people who cant afford a windows license but can afford sql server.

Lmao :nsallears:

jesus WEP
Oct 17, 2004


Shaggar posted:

finally you can get a working db on Linux.
oracle has always worked best on *nix tho :confused:

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

tef posted:

computers are bad

sometimes computers are not too bad

9-Volt Assault
Jan 27, 2007

Beter twee tetten in de hand dan tien op de vlucht.
Every time i try to sit behind my computer my cat decides that it needs attention RIGHT NOW so it goes sit in front of my keyboard or starts trying to push my mouse from my desk. I think its trying to tell me that computer are bad and i should do something else with my life.

Chalks
Sep 30, 2009

the talent deficit posted:

linq is cool but people should learn sql prob if they deal with databases. you have to learn 90% of it to use a lovely query generator anyways, may as well learn the last 10% and not rely on weird magic

Ah, you see, I started off with a 15 year old database and then had to implement entity framework database first which is something that entity decided wasn't supportable a long time ago. Hand crafting the entity generation logic onto a database that's only ever been interacted with using SQL certainly teaches you a lot about both technologies.

Now, not only do I know the data structures by heart, but I also have an intimate understanding of how the entities work and when it's all inevitably broken as gently caress, it's entirely my fault!

You really get a good understanding for why entity abandoned database first generation when you embark on something like this. Holy poo poo.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
what is a good tool for database migration?

we use liquibase but it seems to get easily confused about what changes it has already run and wants to rerun changes and gently caress up everything.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
well, it does not get confused if you run it in the same exact circumstances, during the application startup

but it doesn't seem to like also being run from the command line.

Bloody
Mar 3, 2013

Shaggar posted:

use dapper. also: use stored procs

can confirm: dapper is good

jesus WEP
Oct 17, 2004


:same:

although it'd own even harder if theres a way of getting it to infer that butt_size in the db is the same as the Size property of the Butt it's constructing

Ciaphas
Nov 20, 2005

> BEWARE, COWARD :ovr:


a coworker of mine mentioned stored procs are the devil's rear end in a top hat wrt portability, i.e. stored procs are the main reason we're all totally stuck on oracle db even though we all hate it and would benefit from a move to mssql

I'm not au fait with databases, how true is this? i thought stored procs were just like... c functions i guess?? only for sql, so syntactic shortcuts for long queries i guess??`

jesus WEP
Oct 17, 2004


if your oracle procs are inside packages you can't set them up in mssql with the exact same name

in oracle your fully qualified proc name will be database.schema.package.proc and in mssql it would just be database.schema.proc

e: you could have a separate schema in mssql for each oracle package though i guess?

jesus WEP fucked around with this message at 19:44 on Nov 19, 2016

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Wheany posted:

well, it does not get confused if you run it in the same exact circumstances, during the application startup

but it doesn't seem to like also being run from the command line.

i use flyway, but only ever from the command line so i dunno about your problem

Adbot
ADBOT LOVES YOU

jony neuemonic
Nov 13, 2009

Ciaphas posted:

a coworker of mine mentioned stored procs are the devil's rear end in a top hat wrt portability, i.e. stored procs are the main reason we're all totally stuck on oracle db even though we all hate it and would benefit from a move to mssql

I'm not au fait with databases, how true is this? i thought stored procs were just like... c functions i guess?? only for sql, so syntactic shortcuts for long queries i guess??`

i don't know about oracle specifically, but stored procs aren't inherently good or bad for portability in my experience. they're like any other queries: if you use a bunch of vendor-specific features, they're not gonna be portable.

i've only used postgres in any depth though (still just starting to use mssql and the less said about mysql the better).

  • Locked thread