Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: DBI isn't using default row values

by CountZero (Bishop)
on Nov 29, 2016 at 07:22 UTC ( [id://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.

CountZero

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-24 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found