From: Austin Ziegler Date: 2004-11-25T01:09:53+09:00 Subject: Re: Other ORMs [was: rails is awesome] On Thu, 25 Nov 2004 00:24:04 +0900, Dick Davies wrote: > * Austin Ziegler [1109 15:09]: >> On Thu, 25 Nov 2004 00:01:11 +0900, Dick Davies >> wrote: >>> * Austin Ziegler [1142 14:42]: >>>> In practice, with a putative Oracle connector to AR, AR simply >>>> won't work, because Oracle's metadata tables always return the >>>> data in uppercase -- unless the table name is quoted. >>>> >>>> MySQL is a bad model -- it doesn't actually do much of anything >>>> right. >>> And you just found this out? >>> Have you been living in a cave for the last 5 years? :) >> No, I've known it for a long time. I just didn't realise until >> the last couple of days that ActiveRecord embeds MySQL semantics >> into its otherwise nice data modeling techniques. > Sorry, I'm being flippant because I'm creating a db for rails to > use, so I don't see this as a big issue. Having a legacy DB would > probably sober me up. Well, the case that I saw was an external tool being used to create a MySQL database -- and this creates tables with a default column of "Id", forcing you to rename the column. Now, being a hardcore database guy, I create all of my databases from a script, but I got to thinking about how dumb this was for ActiveRecord to miss, given that it gets everything else right. Then I started looking at MySQL, and noted that on MySQL, it's not even consistent -- on Windows, where filenames are case-preserving[1] then "id" and "Id" are the same thing, but on Unix they're not. > But surely even then this shouldn't affect many people? (my class > still starts with a capital letter, right? And how many people > have a customers and a Customers table? ) It would affect anyone that uses a real SQL92-compliant database system. > But again, I'd see the postgres (or oracle, etc, etc) adapter as the > place to scatter a little 'tablename'.casecmp() magic to fix that.. I'm not sure about that. The issue does come in when you have quoted tablenames as opposed to unquoted tablenames. ActiveRecord should probably assume and enforce unquoted tablenames -- which means case- insensitive tablenames. -austin [1] This is the right way to do case handling on filesystems. Even HFS+ does it this way, even if UFS doesn't. I've never seen any reason why the presence of Makefile and makefile would be considered a Good Thing. Case-preserving is different than straight case-insensitivity. -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca