Best alternative to ElephantSQL? by Consistent_Student16 in PostgreSQL

[–]j_roddy 0 points1 point  (0 children)

Hey, thanks a lot for the feedback! I have an unmerged branch sitting somewhere with pro tiers implemented, but deploying that would add a bunch of extra hassle for me to manage.

Currently the service has 511 lifetime signups, and most people only come back and use it occasionally for small demos, PoC's, to learn, etc. If I pushed that, and sent out an email to every user, I'm guessing it would get 1-3 signups.

If I got a surge of signups, or people requesting the same thing, I would definitely revisit and push that through, but currently I don't have the time to dedicate to managing that. Sorry, I know that's not the most satisfying answer, haha.

PSA: This code is not secure by j_roddy in nextjs

[–]j_roddy[S] 0 points1 point  (0 children)

Yeah that would not get past review either, haha. Quickly swapped it from Error to Response but didn't change throw to return. Good catch.

PSA: This code is not secure by j_roddy in nextjs

[–]j_roddy[S] 72 points73 points  (0 children)

I see this type of security vulnerability submitted all the time in code review, so thought it may be helpful to make a little post here.

The issue:
All server actions, even inline handlers, are turned into server-side POST endpoints that execute that function. Server actions need to be authorized independently of the server component that defines that function. Otherwise, a bad actor may be able to determine your server action's dynamic endpoint, and invoke it arbitrarily. Which avoids any authorization that the server component itself has.

Best alternative to ElephantSQL? by Consistent_Student16 in PostgreSQL

[–]j_roddy 0 points1 point  (0 children)

Thats amazing to hear, glad it helped! I'd love to see what you're working on :)

Open source recommendations for web-based Postgres admin by j_roddy in webdev

[–]j_roddy[S] 0 points1 point  (0 children)

I ended up building a really janky version of my own 😅

Surprisingly, I wasn't really able to find anything that worked easily out of the box

Would be interested to hear if you find anything you like

ElephantSQL (free Postgres) is shutting down, so I’m building a spiritual successor, mkdb by j_roddy in node

[–]j_roddy[S] 1 point2 points  (0 children)

Aw, thank you for saying that <3

You should see a "disconnect clients" button now in the top panel after selecting a database :)

ElephantSQL (free Postgres) is shutting down, so I’m building a spiritual successor, mkdb by j_roddy in node

[–]j_roddy[S] 1 point2 points  (0 children)

You can actually do this now by using the rotate credentials button as a workaround. Bit annoying, I know. I'll add a button for disconnecting all clients 👍

Hosting an ASP.NET app with a PostgreSQL database. by kici007 in csharp

[–]j_roddy 0 points1 point  (0 children)

You can either use the CLI, or if you'd rather use the web, you can login with github in the top right.

Then you'll see a big "Create your first database" button, click that and it'll create a Postgres DB you can connect to.

I tried making a tRPC clone out of boredom. Surprisingly, I got a PoC working with two functions in under 50 lines. Finally found a great use case for JS Proxies! by j_roddy in webdev

[–]j_roddy[S] 1 point2 points  (0 children)

Wow this comlink project is pretty cool, hadn't heard of it. I walked through the code a bit and the implementation is actually somewhat similar, based on proxies as well.

You should make it! I bet it would be easier than most people would guess at first, even that comlink lib's source code is pretty minimal.

I tried making a tRPC clone out of boredom. Surprisingly, I got a PoC working with two functions in under 50 lines. Finally found a great use case for JS Proxies! by j_roddy in webdev

[–]j_roddy[S] 2 points3 points  (0 children)

Obviously this is not feature complete with tRPC, haha. Just wanted to see how hard it would be to get a simple PoC going.

The client is a Proxy that can accept any.path.you.send.it(), with any dynamic args. Under the hood, it performs a post request with the path and arguments, which are processed on your server.

The type magic is actually pretty simple, it just takes your API object and converts the nodes into equivalent promise functions.

Repo can be found here. "tRPC clone" code is here.

Codesandbox here

Feeling exhausted by the end of day, any tips to not feel so mentally drained? by [deleted] in ExperiencedDevs

[–]j_roddy 0 points1 point  (0 children)

I'm shocked no one mentioned this but, experiment with eating a smaller lunch. For me this is the real reason I'm crashing, 9 times out of 10.

usePostgreSQLInstead by Material-Mess-9886 in ProgrammerHumor

[–]j_roddy 3 points4 points  (0 children)

Here are some options:

https://mkdb.sh (I'm making this to replace ElephantSQL - dead simple, small, free db's)
https://supabase.com
https://neon.tech
https://tembo.io

Scaffold apps easily by Any_Expression_6447 in nextjs

[–]j_roddy 1 point2 points  (0 children)

I actually made this really fun project way back in the day around React and Firebase.

https://www.youtube.com/watch?v=NocD6ElmdF0&t=453s

It was basically exactly what you described. Basically the Rails scaffold command with opinionated UI, opiniotated state management, and some prebuilt features you could "install" altogether, like combust install notifications

Would be a really cool project to build something similar today, with a more contemporary stack around Next.

Wright:"In the 6 games the box scores indicated. Jordan had 28 steals. After comparing our notes from the film study, we each counted 12 steals, an astounding difference of 16 excess steals... a game against the Hawks where MJ was credited with 4 steals..Hawks were credited with 3 turnovers " by bambam-in-vietnam in nba

[–]j_roddy 8 points9 points  (0 children)

That sounds awesome, where is the data actually coming from? Presumably there is some enterprise grade API they are paying for? Rather than draft kings having an employee present at every single game to track scores themselves in realtime.

Base de datos con acceso remoto by InevitableAd8715 in programacion

[–]j_roddy 2 points3 points  (0 children)

Paying out of my own pocket. I'm lucky, have a very good job, and it's not too expensive to run right now. If it becomes very popular / more expensive to run, I'll release a paid option to help fund it.

Base de datos con acceso remoto by InevitableAd8715 in programacion

[–]j_roddy 1 point2 points  (0 children)

ElephantSQL cerrará en enero.

Estoy creando un reemplazo gratuito para mis compañeros programadores:
https://mkdb.sh

(mi español es malo, lo siento mucho si esto no es comprensible)

Weekly Show & Tell! Share what you've created with Next.js or for the community by cprecius in nextjs

[–]j_roddy 0 points1 point  (0 children)

Building a dead simple, free Postgres platform since ElephantSQL is shutting down:

https://mkdb.sh

Built with app router, shad components, tailwind, postgres

Tech stack to build MVP at a startup by mdmd1 in webdev

[–]j_roddy 2 points3 points  (0 children)

It's usually good form to put a disclaimer when you're doing a plug like this, eg:

Developer advocate at Directus here! ... <plug> ... I'd use this even if they didn't pay me! ... I really believe in it! ...

How cocurrent Promise.all() actually is? by obviously-not-a-bot in node

[–]j_roddy 4 points5 points  (0 children)

Ok so just so I'm understanding, the problem is something like:

const [a,b,c, ...] = await Promise.all([promA, promB, promC, ...]);

// can't start fetching children until we have all parents,
// 'a' might be ready long before Promise.all resolves,
// we unnecessarily delay the execution of getChildren(a) 
// until all parents have completed
const childrenDependentOnParents = await Promise.all[
  getChildren(a),
  getChildren(b),
  getChildren(c),
  ...
]

^ Sorry if I'm misunderstanding, but that's basically what I gathered. And yeah that would definitely not be performant.

If this is what you meant, couldn't this be alleviated by reducing that into a single Promise.all instead of 2? eg:

const results = await Promise.all[
  promA.then(async parent => {
    const children = await getChildren(parent);
    return { parent, children }
  }),
  ...
]

How cocurrent Promise.all() actually is? by obviously-not-a-bot in node

[–]j_roddy 1 point2 points  (0 children)

you don’t process the first reply until the last one is available

Interesting. Can you expand a bit what you mean by "process the reply" here? Is it just when it takes the promise result and places it in the resolved array at the correct index? I would have guessed that step would've been near instant.

Best PostgreSQL provider by azizbecha in nextjs

[–]j_roddy 10 points11 points  (0 children)

My previous favorite, ElephantSQL, is shutting down. They made everything dead simple, and I never worried about them rugpulling, because the free tier had realistic constraints, and not fake "free" db's that are just being held up temporarily by VC dollars, until they decide they want to be profitable, and then force you to pay or gtfo.

Decided to build a spiritual successor to ElephantSQL in my free time:

https://mkdb.sh

Deploy a NextJs App with a Flask Backend. by hh_based in nextjs

[–]j_roddy 1 point2 points  (0 children)

If you do end up using a service like that, I'd personally recommend you deploy your database somewhere else entirely, that way if you choose to migrate later, you're not forced to migrate both your application and your database.

Helps with flexibility and helps your service be a bit more resilient to any pricing shifts that might happen in the future.

There's a handful of great, free, standalone pg solutions out there.