
brion at wikimedia
Aug 22, 2008, 9:22 AM
Post #7 of 8
(587 views)
Permalink
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Aryeh Gregor wrote: > On Thu, Aug 21, 2008 at 7:23 PM, Brion Vibber <brion [at] wikimedia> wrote: >> In my opinion that would be a bit horrifyingly scary. ;) Domain-specific >> knowledge is better placed in domain-specific classes... > > Well, having pgsql and all the other BOOL-supporting DBMSes forced to > use integer types just because devs are too lazy to make sure things > work properly on all databases is exactly the sort of thing the > abstraction layer is meant to prevent. You *do* realize that "1" and "0" are valid values for PostgreSQL's genuine BOOL type, right? > Each database should be able > to properly use its own features. Introducing domain-specific > knowledge is kind of icky, but I can't think of any other way to do > it. We use type-specific wrappers for formatting timestamp values appropriately, so clearly there is another way to do it. :) >> Proper behavior for overlong input can vary. Sometimes we want to reject >> it outright, since it's invalid -- an overlong page title, username, or >> group name wouldn't function correctly truncated. > > I suggested truncation because that's what MySQL would normally do, > and so it's what we're probably relying on in some cases already. We must not rely on that, since MySQL may be configured in strict mode, which will whine at truncation. > More sensible behavior would be to throw an exception, rather than > having it silently sort of work on MySQL but fail elsewhere (including > MySQL in strict mode). Right, that would throw an exception due to the database error. - -- brion -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkiu59UACgkQwRnhpk1wk452pQCgl37pBBMscVZROntJYoJ8E82o LJUAoMqETMHsegJ08ob3J51X2GhlgcZ9 =WPW1 -----END PGP SIGNATURE----- _______________________________________________ Wikitech-l mailing list Wikitech-l [at] lists https://lists.wikimedia.org/mailman/listinfo/wikitech-l
|