|
Oben posted:Well, gently caress. Is there a way to use views in MySQL 4, or do I really have to go in and somehow rewrite the database and php code that accesses it? Views have changed my life. For serious. I used to *hate* writing SQL stuff in PHP, and in fact I still do. Being an Object Oriented nut, I'm deeply fond of things like Active Record and its ilk. The problem with Active Record is that it tends to suck for complex queries. So along comes Views and its all better now. You just use a view to turn a complex query into a simple minded query, and then your code magically starts being lovely and simple. The beauty of it is, since data tends to repeatedly be looked at the same way over and over, you just keep reuseing the same view. Caveat: Beware of how agregation and parameterised querys nest when doing things like views of views. code:
Caveat. Views tend to dislike this sort of thing;- SELECT * FROM TABLE Your better off using something like SELECT raraID,raraName,raraHeyMan FROM TABLE . This means you need to watch what happens with your views when you change the tables they are dependant on. If you add a field to a dependancy , you might need to add that field to the view. I tend to keep a views.txt file with my code project s that have copies of all the views inside them. duck monster fucked around with this message at 22:30 on Nov 5, 2007 |
# ¿ Nov 5, 2007 17:32 |
|
|
# ¿ Apr 19, 2024 12:15 |
|
Sort of on/off topic, BUT;- If anyones ever wondered about how sql type databases actually work at the core, have a read of this;- First read this;- http://www.sqlite.org/arch.html Then read this;- http://www.sqlite.org/vdbe.html Its on how the SQL engine in SQLLite's opcode system works. Its fascinating stuff, and really is quite enlightening the process of going from really high level SQL query, to snappy-as-gently caress low level data retrieval. Its amazing stuff (Probably more so , considering what a wonder that little database really is.) Honestly, after having a dig around the *excelent* developer documentation for SQLLite, I now know a hell of a lot more about how these things work than I used to. Required reading.
|
# ¿ Dec 7, 2007 08:55 |
|
Does anyone know if its possible to get Multicorn (The Postgres plugin that lets you write Foreign Data Wrappers in python) working in Azures Postgress service? We have a giant legacy OSC OSI PI thing (Big ugly enterprisey timescale database thing) that we all hate using but its kinda core to our operation. We're toying with ideas how to cut that expensive crackpipe out and as a first step accessing it via a FTW means we can later on just move it to a local timescaledb table instance. It might just be a hare brained scheme, but we'd like to try it.
|
# ¿ Sep 13, 2022 07:05 |
|
If your going into an existing codebase/deploy with an existing style guide, that is *always* going to be the one you want to use. snake_case and pluralized tables might be more logical, but in the scheme of things, its just a preference, and bucking the teams preference isn't a good way to remain employed. And yeah, I prefer just using id for the index too, because it means theres always a predictable pk, but again, its a preference, and mob rules when it comes to teamwork.
|
# ¿ Oct 26, 2023 06:30 |
|
Y'all fools aint seen nothing till you've worked with a database designed by scientists. Horrors without end. "I just copied the field names from excel but for some reason it wont let me use spaces" "I just put the code in a text field and then use pythons exec command to run it" "Ever Their praises, and abundance to the Black Goat of the Woods. Iä! Shub-Niggurath! Iä! Shub-Niggurath! The Black Goat of the Woods with a Thousand Young"
|
# ¿ Oct 27, 2023 02:57 |