[Dbix-class] inflate_column and sql_maker->quote_char/name_sep

Matt S Trout dbix-class at trout.me.uk
Thu Mar 2 21:13:17 CET 2006


On Thu, Mar 02, 2006 at 01:27:33PM -0600, Brandon Black wrote:
> On 3/2/06, Bernhard Graf <dbic at augensalat.de> wrote:
> > Matt S Trout wrote:
> >
> > > > use base 'DBIx::Class::Schema';
> > > > __PACKAGE__->load_classes;
> > > > __PACKAGE__->storage->sql_maker->quote_char('`');
> > > > __PACKAGE__->storage->sql_maker->name_sep('.');
> > > >
> > > > ?
> > > >
> > > > This gives me:
> > > >
> > > > Can't call method "sql_maker" on an undefined value at
> > > > TDW/Schema.pm line 10. Compilation failed in require at app.pl line
> > > > 6.
> > > > BEGIN failed--compilation aborted at app.pl line 6.
> > >
> > > Ah. Storage isn't initialised unril you call connect/connection, as
> > > noted in the DBIx::Class::Schema docs. Should have mentioned that,
> > > sorry.
> >
> > I'm really confused now.
> > What do you mean with "isn't initialised"? Undefined?
> >
> > Does that mean, that in my application code I have to call
> > my $schema = CLASS->connect()
> > first and then
> > $schema->storage->sql_maker->quote_char('`');
> > $schema->storage->sql_maker->name_sep('.');
> > ?
> >
> > What about $schema->storage->on_connect_do() then?
> > Looks like a hen-egg problem...
> 
> Are those sql_maker settings generic to MySQL in general?  We could
> put them in Storage/DBI/Mysql.pm in -current.

Tempting, but for high-load applications I wonder if quote_char having to do
the split-quote-join dance on everything would be a pointless overhead if
your database doesn't use anything reserved.

-- 
     Matt S Trout       Offering custom development, consultancy and support
  Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Dbix-class mailing list