Re: [RDBO] default values

2006-06-29 Thread Jonathan Vanasco
On Jun 29, 2006, at 2:12 PM, John Siracusa wrote: > Should it be this? > > INSERT INTO mytable (name) VALUES ('foo'); > > Or should it be this? > > INSERT INTO mytable (name, flag) VALUES ('foo', 1); > > They may seem identical, but now imagine if the default value in the > "flag" column

Re: [RDBO] default values

2006-06-29 Thread John Siracusa
On 6/27/06, John Siracusa <[EMAIL PROTECTED]> wrote: > The update() method has a changes_only parameter that instructs it to only > update the columns whose values have been modified. I suppose I should add > the same option to the insert() method (thus making it also valid on all > calls to the s

Re: [RDBO] default values

2006-06-27 Thread Jonathan Vanasco
On Jun 27, 2006, at 4:46 PM, John Siracusa wrote: > Right, because you did not specify a default value for the "active" > column, > and RDBO includes values for all columns on insert. correct. i got that from the docs. >> is there any way to not define the default value in perl, and just >> l

Re: [RDBO] default values

2006-06-27 Thread John Siracusa
On 6/27/06 3:03 PM, Jonathan Vanasco wrote: > if postgres is this: > > create table stuff ( id integer not null primary key , name varchar > (40), active boolean default true ); > > and rosedb::object subclass is this > > __PACKAGE__->meta->table('stuff'); > __PACKAGE__->meta->columns(qw(id name

Re: [RDBO] default values

2006-06-27 Thread Clayton Scott
On 6/27/06, Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > i noticed just now... > > if postgres is this: > > create table stuff ( id integer not null primary key , name varchar > (40), active boolean default true ); This seems like something the DB should handle. What happens when you modi

[RDBO] default values

2006-06-27 Thread Jonathan Vanasco
i noticed just now... if postgres is this: create table stuff ( id integer not null primary key , name varchar (40), active boolean default true ); and rosedb::object subclass is this __PACKAGE__->meta->table('stuff'); __PACKAGE__->meta->columns(qw(id name active )); __PACKAGE__->meta-