Setting utf8_bin as a default collation is not a good solution.
It is better to have an ability to specify it like in MySQL:

in table definition
in column definition
in queries
(in database definition???)

So it might be better for Mister Gibson to use migrations with custom
queries to
specify the collations where they are needed.

-------------
By the way -
I've recently had a lot of that collation things (in java project with
hibernate as an ORM).
And you know what ? Also with German language :)))

I had to set character set to utf8  and collation to utf8_bin (because it
makes difference
between o and ö symbols for example when sorting or search is involved).

BUT!! this utf8_bin is not good when you have a list of results sorted by
the field where it is specified.
It puts all symbols with umlaut to the and of the list. For example

create table foo (
  ....
  name varchar(255) character set utf8 collate utf8_bin,
  ...
) ...;

select * from foo order by name;

Name
==========
abc
olga
zero
xxx
ösomething <===!!!

(My customer didn't like it at all. And now I have to create a custom
collation)

to have it sorted in a way that was needed:

Name
==========
abc
olga
ösomething <===!!!
zero
xxx

I would have to write a query with other collation specified:
select * from foo order by name collate utf_unicode_ci;

It is even possible to specify the collations in two places:
select * from foo where name like "ö%" collate utf8_bin order by name
collate utf_unicode_ci;

Would be great if dm-* would allow it :)

Best regards,
Nick

On Sat, Jan 31, 2009 at 7:49 AM, Dan Kubb (dkubb) <[email protected]>wrote:

>
> Mister,
>
> > I may be mistaken, but I find I'll have to set some low level mysql
> > table-level settings.  Unfortunately, the current property list for a
> > table doesn't appear to support the following:
> >
> > ENGINE = InnoDB (or does dm fake transaction support?)  Just don't want
> > to be tripping on toes here.
> >
> > CHARACTER SET seems its utf8 by default, but:
> > COLLATE I'll need to set to 'utf8_bin' (or it messes up some german
> > strings) *prior* to adding string columns.
>
> Greg Campbell committed some fixes in dm-more that will make it into
> the next gem release:
>
>
> http://github.com/datamapper/dm-more/commit/ba9e29e13ffa506978530b729cd615e2e3d52a70
>
> NOTE: To use edge dm-more, you'll also need the edge versions of dm-
> core, DO, and extlib.
>
> The tables will all be created with InnoDB.  The character set and
> collation are determined by your connection settings.  With do_mysql I
> believe you can specify the :encoding option when setting up your
> connection, but I do not think there is a way to specify the collation
> yet.
>
> You may want to look at MySQL's docs to see if there's a way to
> configure the default collation in the my.cnf.  I'm sure there is,
> I've never found anything I wasn't able to configure that way.
>
> > AVG_ROW_LENGTH, and MAX_ROWS I'll have to set on large deployments or
> > I'll run into a file size limitation.
>
> DM and DO don't have ways to configure these options.  For these you
> will need to consult the MySQL config docs.
>
> --
>
> Dan
> (dkubb)
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to