Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: DBI isn't using default row values

by CountZero (Bishop)
on Nov 29, 2016 at 07:22 UTC ( #1176771=note: print w/replies, xml ) Need Help??

in reply to DBI isn't using default row values

More generally, I find default values to be hazardous.

You can have defaults at the level of your database, or at the level of a framework like DBIx::Class or Moose, or in your application code.

Invariably, after a while somehow working with your database and code will fail to read the docs or simply forgets about all these different defaults and introduces hard to trace errors. Or as in the case of the OP, just doesn't know how to trigger the defaults.

I think it is much better if the database complains loudly when a required field remains empty. Then it is immediately obvious where the error is.


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1176771]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2023-03-26 08:42 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (63 votes). Check out past polls.