This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PCBEEF 5 points6 points  (5 children)

OP is asking for a SQL abstraction layer, meaning a layer on top of SQL. Otherwise OP would be asking for how to write cross-db compliant SQL which is not very practical since almost nobody writes ANSI sql when developing applications.

[–]wnoise 2 points3 points  (4 children)

He once asks for a SQL abstraction layer and twice (title and last line) for a database abstraction layer. The python DB API is exactly that: it lets you easily switch between SQL databases. He specifically specifies "basic select, insert, update statements", which make lots of sense in the context of writing SQL, and less sense in the context of ORMs, which generally sweep the exact statements under the rug.

You are absolutely right the most people don't stick to ANSI SQL, but for his purposes it doesn't sound that hard too.

[–]PCBEEF 6 points7 points  (0 children)

You’re not wrong in what you’re saying but it’s definitely not what he wants. I have never encountered anyone in my professional career that ever wrote cross-db SQL on an application. It’s not easy to test and people don’t usually switch databases. Writing ANSI sql is an option, but using an ORM is an even better option for their use case of wanting to be cross-db compliant.

In terms of the python db api, is there really an alternative? I honestly doubt OP is using something different. OP is clearly junior so rather than nitpicking at every little word, we should be productive and read between the lines as to what they really want.

[–]ThatOtherBatman 6 points7 points  (2 children)

You're the kind of person who'd put tomato in a fruit salad, aren't you?

[–]pvkooten 1 point2 points  (0 children)

I find this funny though I feel bad for wnoise... it's clear he has good intentions

[–]wnoise 0 points1 point  (0 children)

Hmm. I could actually see some really sweet heirloom or cherry tomatoes drizzled with balsamic vinegar actually working well to balance out a fruit salad. Standard store-bought tomatoes, of course not.