Live data from Hacker News

Getting AI to write good SQL

cloud.google.com

131–140 of 379 posts

Re: Getting AI to write good SQL

#132
post #110

Every once in a while I've been trying AI, since everyone and their mother told me to, so I comply. My recent endevour was with Gemini 2.5: - Write me a simple todo app on cloudflare with auth0 authentication. - Here's a simple todo on cloudflare. We import the @auth0-cloudflare and... - Does that @auth0-cloudflare exists? - Oh, it doesn't. I can give you a walkthrough on how to set up an account on auth0. Would you…

The worse part is not even being trolled at AI roundabout. The worse part is gaslighting by people who then go on to imply that I'm dumb to not be able to 'guide' the model 'towards the solution', whatever the fuck that means. And this is after telling me that model is so smart to just know what I want.

Claude and Gemini are pretty decent at providing a small and tight function definition with well defined parameters and output, but anything big and it starts losing shit left and right.

All vibecoding sessions I've seen have been pretty dead easy stuff with lot of boilerplate, maybe I'm weird for just not writing a lot of boilerplate and rely on well-built expressive abstractions..

Re: Getting AI to write good SQL

#133

Earlier quoted context omitted.

It is absolutely the greatest golden age in programming ever - all these infinitely wealthy companies spending bajillions competing on who can make the best programming companion. Apart from the apologising. It's silly when the AI apologises with ever more sincere apologies. There should be no apologies from AIs.

companion or replacement?

They are a replacement if your job is only to write code.

Especially if your code contains a few bugs, misconceptions, and is sometimes completely unable to fix mistakes, going back and forth into the same wrong solutions.

This is not to say that AI assistants are useless. They are a good productivity tool, and I can output code much faster, especially for domains I am very familiar with.

That said, these starry-eyed AI circlejerk threads are incredibly cringe.

Re: Getting AI to write good SQL

#134

Can I just say that Google AI Studio with latest Gemini is stunningly, amazingly, game changingly impressive. It leaves Claude and ChatGPT's coding looking like they are from a different century. It's hard to believe these changes are coming in factors of weeks and months. Last month i could not believe how good Claude is. Today I'm not sure how I could continue programming without Google Gemini in my toolkit. Gemini…

Absolutely agree. I really pushed it last week with a screenshot of a very abstract visualisation that we’d done in a Miro board of which we couldn’t find a library that did exactly what we wanted, so we turned to Gemini.

Essentially we were hoping to tie that to data inputs and have a system to regularly output the visualisation but with dynamic values. I bet my colleague it would one shot it: it did.

What I’ve also found is that even a sloppy prompt still somehow is reading my mind on what to do, even though I’ve expressed myself poorly.

Inversely, I’ve really found myself rejecting suggestions from ChatGPT, even o4-mini-high. It’s just doing so much random crap I didn’t ask and the code is… let’s say not as “Gemini” as I’d prefer.

Re: Getting AI to write good SQL

#135

Can I just say that Google AI Studio with latest Gemini is stunningly, amazingly, game changingly impressive. It leaves Claude and ChatGPT's coding looking like they are from a different century. It's hard to believe these changes are coming in factors of weeks and months. Last month i could not believe how good Claude is. Today I'm not sure how I could continue programming without Google Gemini in my toolkit. Gemini…

I asked it to make some changes to the code it wrote. But it kept pumping out the same code with more and more comments to justify itself. After the third attempt I realized I could have done it myself in less time.

Re: Getting AI to write good SQL

#136
post #122

Earlier quoted context omitted.

And Gemini is free.

Well, as with many of Google's services, you pay with your data. Pay-as-you-go with Gemini does not snort your data for their own purposes (allegedly...).

Undoubtedly, but a significant positive aspect is the democratization of this technology that enables access for people who could not afford it, not productively, that is.

Re: Getting AI to write good SQL

#137
post #110

Every once in a while I've been trying AI, since everyone and their mother told me to, so I comply. My recent endevour was with Gemini 2.5: - Write me a simple todo app on cloudflare with auth0 authentication. - Here's a simple todo on cloudflare. We import the @auth0-cloudflare and... - Does that @auth0-cloudflare exists? - Oh, it doesn't. I can give you a walkthrough on how to set up an account on auth0. Would you…

It's difficult to assess how typical your experience is; I tried your initial prompt (`Write me a simple todo app on cloudflare with auth0 authentication.` on gemini-2.5-pro-preview-05-06) and didn't get any mentions of @auth0-cloudfare, although I cannot verify if the answer is working as-is

https://pastebin.com/yfg0Zn0u

Re: Getting AI to write good SQL

#138
post #110

Every once in a while I've been trying AI, since everyone and their mother told me to, so I comply. My recent endevour was with Gemini 2.5: - Write me a simple todo app on cloudflare with auth0 authentication. - Here's a simple todo on cloudflare. We import the @auth0-cloudflare and... - Does that @auth0-cloudflare exists? - Oh, it doesn't. I can give you a walkthrough on how to set up an account on auth0. Would you…

The worse part is not even being trolled at AI roundabout. The worse part is gaslighting by people who then go on to imply that I'm dumb to not be able to 'guide' the model 'towards the solution', whatever the fuck that means. And this is after telling me that model is so smart to just know what I want. Claude and Gemini are pretty decent at providing a small and tight function definition with well defined parameters…

Remember, if AI couldn't solve your problem, you were probably using the wrong model. Did you try with o5-selfsuck-20250523-512B?

Re: Getting AI to write good SQL

#139

Can I just say that Google AI Studio with latest Gemini is stunningly, amazingly, game changingly impressive. It leaves Claude and ChatGPT's coding looking like they are from a different century. It's hard to believe these changes are coming in factors of weeks and months. Last month i could not believe how good Claude is. Today I'm not sure how I could continue programming without Google Gemini in my toolkit. Gemini…

How do you use it exactly? Does it integrate with any IDEs?

There is Gemini Code Assist.

https://developers.google.com/gemini-code-assist/docs/overvi...

Re: Getting AI to write good SQL

#140
post #35

> We will cover state-of-the-art [...] how we approach techniques that allows the system to offer virtually certified correct answers. I don't need AI to generate perfect SQL, because I am never going to trust the output enough to copy/paste it — the risk of subtle semantic errors is too high, even if the code validates. Instead, I find it helpful for AI to suggest approaches — after which I will manually craft the S…

Hopefully your trust in yourself is warranted

You'd rather trust in AI than yourself?
Post reply on HN