[Dbix-class] Newcomer questions ?

Ivan.Georgiev at uboc.com Ivan.Georgiev at uboc.com
Wed Nov 1 17:55:16 GMT 2006



]- hi thanx,

In the case of TRUNCATE TABLE it may be worth checking the comparison of
that against DELETE FROM TABLE - if you are doing this without a WHERE
clause the 2 may be equivalent and the DELETE form can be expressed as a
resultset operation.

]- no I want to delete the whole table..and on mysql TRUNCATE is quicker.

> 3. Is it possible to create table on the fly and after that generate
> class for it, i mean runtime ? an example if possible will be good !

You can create a class and create the table from it. Examples of this
can be found in the DBIx::Class test suite and some documentation in
DBIx::Class::Schema (deploy)

]- I don't know in advance the table name... the situation is like this,
There is tables for differnt days, say Blah20061101,Blah20061102... and in
the script i must check for which days table already exists (there can be a
gaps),
and if some table i need is missing to create it and add some records.
I mean I can't create the class as a file in advance !!!

thank you again

Some other questions i got :

- If I want to put validation code, where I do put it ? Do I override
inflate/deflate
in my table-class ?
- will transactions work on mysql (myisam)
if I use them like specified in the example i found somewhere in the docs:)
?
 (MyISAM doesn't support transactions.)
- How do you handle errors (like any other perl code i.e. eval{}; if $@...)
?
  OR there a central place I can catch the errors ? ...
  mmm, sorry I saw there is exception_action() in dbix::class::schema ;)



-







******************************************************************************
This communication (including any attachments) may contain privileged or
confidential information intended for a specific individual and purpose, 
and is protected by law.  If you are not the intended recipient, you should
delete this communication and/or shred the materials and any attachments and
are hereby notified that any disclosure, copying, or distribution of this
communication, or the taking of any action based on it, is strictly prohibited.

Thank you.




More information about the Dbix-class mailing list