• 0 Posts
  • 21 Comments
Joined 10 months ago
cake
Cake day: September 10th, 2023

help-circle

  • The fun comes when there is no actual data model. All in all, I’d say being familiar with the data model is about 60% of my job. 35% is building queries and query scripts for people who need regular exports. 5% is running after other people’s fuckups.

    Strap in, because this is a ride.

    There is a raw database from a decade-and-a-half old app, which I get to access through a layer of views that does some joining, but not all, with absolutely no documentation on how the original database is structured or where things are pulled from or what anything refers to. No data dictionary, no list or map of key relations, some objects are mapped in two different views, no semantic naming of columns.

    If you want to want to query order part delegations by who they’re assigned to (Recipient in the app) you need to use the foreign key RefAssignmentUnit. The “Assignment” unit that did the delegation is just RefUnit. If you have orders that were created by a salesperson on behalf of a customer, OrderingPerson (also a foreign key, but not named Ref-) is the customer, while OrderingPerson2 is the salesperson that entered the order. Don’t confuse that with Creator, which for orders created through the web form is usually a technical user, unless the salesperson is one of the veterans that use the direct app in which case it’ll be the salesperson while OrderingPerson2 is null.

    Also, we have many-to-many relationships that are mapped through reference tables… whose columns are named object and reference for each and every one. Have fun trying to memorize which refers to which so you don’t need to look it up every damn time.

    Create my own views to clean this up? Nope, only the third party service providers for the app can do that, and they don’t wanna. Our internal app admin (singular) can use some awkward tool to generate those views, but there’s no reverse lookup to see what a given column refers to. Also, they have no concept for what actually constitutes a good model because they’re not really familiar with the database, just with the app.

    Get my own serverless DB to create views that query the original DB? No can do, you’d need to order a whole server and that’s pricy.
    Get a cloud DB? Sure, but it will be managed by the cloud team and if you want to have or edit custom views, you’ll get to create a project request. They’ll put it in the backlog and work it into some future sprint.

    Get literally any tool that allows me to efficiently create reusable data prep so I don’t have to copy & paste the base transformations needed for a given query every fucking time and if the source DB ever changes I need to update all my query scripts? If you can somehow squeeze the time to prepare a convincing pitch - a full Power Point presentation, of course - between all your tedious and redundant query preparation and script maintenance, find a management sponsor willing to hear you out and hopefully propose your request to their superiors. Best case: It becomes a whole project - alternatives will have to be considered first, implications, security, costs, and you’ll be the one having to assemble and present that information to management only to have some responsible person point out that it would actually be the remit of a different team… that also works in sprints, has a backlog and will give you no control over your prep.

    And obviously, the app provider doesn’t give us any advance notice of just what will change in the DB with the next update. We only learn that when a view breaks. The app admin can use the tool to refresh the affected views then, while I scramble to determine all the scripts that need to be updated and copy&paste the fix. If a user has been granted their own access to the database, odds are they’ll come crying to me when their modified versions of my queries break.

    There is a lot I like about my job, I acknowledge the difficulties of a historically grown system and service contracts, but the rigid and antiquated corporate culture can go take a long walk off a short pier.








  • Do you mean the individual .git repository tracking changes in a given directory? Or the remote repository server that you push your changes to and can pull other’s changes from? The first one is the fundamental requirement of using git at all, the second is where it gets less trivial.

    It’s not that the software isn’t available. Off the top of my mind, Gitlab offers their community version for free to download and host yourself. I think they even have a Docker image. All you need is to figure out how you would like to do that.

    It’s the usual question of self-hosting - where would you host it? A server at home? The cloud? Should others be able to access it? How? What about security?

    Remotes already hosted by others are just a lot more convenient. You don’t worry about the infrastructure, you just push your code. People like me might get more excited about setting up than the actual coding. It’s the bane of half my projects - gotta get that git workflow in place, think long-term, set up the “mandatory PR with tests before merge” and shit until eventually I have everything set up… and the spark of the original script I wanted to do is gone.

    If you want to focus on coding, the benefit of having a ready setup are hard to dismiss.
    On the other hand, setting up and configuring a server can be a one-time job, so if that’s worth it to you, power to you!






  • If you’re looking for good code, you missed the point of my comment 😄

    If I was looking for an enumeration of valid inputs, I’d make it a selection box rather than a text field that’s supposed to contain a number and give the selections reasonable names. If I want an integral quantity, I’d use a number input field.

    If I have no control over the frontend, that means I’m writing a backend in JS for a bullshit frontend, and no amount of good coding practice is going to salvage this mess.

    I’m also blessedly far away from WebDev now. I work in Data Analytics and if I ever have to do any of this for a living, something has gone very wrong.

    Converting texts into numbers or dates still haunts me though - fuck text inputs for numbers and dates.


  • But what if I don’t want strict comparison? What if my frontend contains a text field for a numeric input and I wanna manually check against each possible valid input value if (input_val == 1) {...} else if (input_val == 2) {...} else if... without having to convert it first or check that it’s actually a number or fix my frontend?

    (I’m sure there are valid use cases for non-strict comparison, I just can’t think of one right now)



  • I once held a temp position in QA. I found a nasty, but obscure error that wouldn’t have popped up until way down the line (and also wrote and submitted a fix). The original developer was annoyed, but the team lead was pretty happy to see me do exactly what I was brought on for: Abusing the app in all the ways I could imagine a user not on the actual dev team doing.

    So yeah, great job tester, great job developer, now we wait for the user to try actually sleeping in it and finding it terribly uncomfortable in the long run, or exerting lateral force instead of the vertical one it was designed for.




  • One I saw had a big depositing area where you’d put your stuff to be weighed, though it did tell you to keep particularly large or heavy articles in the cart. There was a service counter right opposite, so I assume there was some measure of trust that the employees there would see if you pulled suspicious shit.

    Every now and then, that scale would be picky though. Article should weigh 400-500g, but actually weighs in at 503? Yeah let’s flag that for a human to check.

    Blessedly, the employees generally were quick to step up, slap their access token thing on the sensor, recognise the situation and clear it without much need for interaction. Likewise with age controls, quick and no fuss. The UI had its issues but the employees at least made up for it.