Questions tagged [rose-db-object]

Rose::DB::Object is a Perl module, which is the ORM part of the Rose set.

Overview

Rose::DB::Object is a Perl module, which is part of the Rose set. The Rose set is made of :

Database Support

The current databases supported by Rose::DB::Object are th same as the ones supported by :

Links

25 questions
11
votes
2 answers

Perl module "did not return a true value"

I followed the Rose::DB::Object tutorial on CPAN and set up three packages. package My::DB::Object; use My::DB; use base qw(Rose::DB::Object); sub init_db { My::DB->new } package My::DB; use base qw(Rose::DB); ... package Motorcycle; use base…
Weiyan
  • 1,116
  • 3
  • 14
  • 25
4
votes
2 answers

Setting NULL datetime with Rose::DB::Object and MySQL

I could be wrong here, but it looks like there's conflicting standards here. MySQL treats a stored datetime of "0000-00-00 00:00:00" as being equivalent to NULL. (update - only, it seems, if the datetime is defined as NOT NULL) But Rose::DB::Object…
cliveholloway
  • 368
  • 1
  • 2
  • 13
3
votes
2 answers

DBIx Class Row virtual/non-persistent columns

Is it possible to add columns to a DBIx::Class::Row object that are virtual in that they are not saved to the database? I am looking for functionality like Rose::DB::Object provides through its non-persistent columns …
2
votes
1 answer

Can I create a table (if not exists) from Rose::DB::Object metadata?

I'm having trouble finding it in the CPAN documentation -- is there a way to create a table (IF NOT EXISTS) from manually-entered Rose::DB::Object metadata? I'm using SQLite as an engine, if it happens to matter. Thanks!
cdleary
  • 69,512
  • 53
  • 163
  • 191
2
votes
2 answers

How can I force list context in Template Toolkit with RDBO?

I have a TT plugin that does the trivial unique ids: sub get_unique_uid_tt { my ( $classname, $o ) = @_; my %h; foreach my $item ( @{$o} ) { unless ( exists $h{ $item->id } ) { $h{ $item->id } = 1; } } return keys…
Timmy
  • 12,468
  • 20
  • 77
  • 107
1
vote
2 answers

Rose::DB::Object::Manager query with a list of object ids

I'm trying to write a Rose::DB::Object query string using either an Array or a Hash, however I'm unsure how to do it. I'm trying to write an update function based off of certain ID's in a list that are enumerated in the array. I unfortunately do…
Mose
  • 541
  • 1
  • 11
  • 27
1
vote
0 answers

Perl Rose::DB - is there any CAST or CONVERT function to use in relationship clause?

Is there any cast/convert function in Rose::DB e.g. to cast a varchar column to integer? As reference: https://metacpan.org/pod/Rose::DB::Object::QueryBuilder I need use join on two tables as below. ON (t1.id = t3.detail) id column of t1 table is…
Ambr
  • 73
  • 1
  • 8
1
vote
2 answers

Foreign key relationship methods deferred and never created in RDBO

I'm playing with RoseDB::Object on the employees test dataset, and for some reason, I can't get my foreign key relationships ('department' and 'employee') to work on the DeptEmp object. (Class structure below). When I try…
Aurelia Peters
  • 2,169
  • 1
  • 20
  • 34
1
vote
1 answer

Using Rose::DB::Object, how can I auto create an object in a relationship if not found?

I have 2 tables that are 1-to-[0/1]. Is there a way to auto create the relationship object/row using Rose::DB::Object: For example: # detailed_summary is the 1-to-1 relationship # if detailed_summary exist, get it # if not, create a new one with…
Timmy
  • 12,468
  • 20
  • 77
  • 107
1
vote
1 answer

Are Rose::DB::Object::Cached memory cached through different processes?

Are RDBOC objects cached through different processes? I'm thining of running it in mod-perl, and it would factor into things, even though it would mostly be used on things that don't change (much). Also, do relationships referencing RDBOCs use the…
Timmy
  • 12,468
  • 20
  • 77
  • 107
1
vote
1 answer

How can I do a case-insensitive search with Rose::DB::Object?

How can I do a case-insensitive search with Rose::DB::Object? Here is the form of a Rose::DB::Object search: my $my_matches = $_my_table_class_mgr->get_objects( query => [ my_field => $my_value, ], ); Is there something I can add to…
user1418094
1
vote
1 answer

Rose::DB doesn't seem to recognize Postgres sequence

My code is simple: eval { my $item = $_table1_class->new( field1 => $val1, field2 => $val2, field3 => $val3, ); $item->save; }; if ($@) { . . . # Error handling stuff. . . . } When the code…
user1418094
1
vote
1 answer

Perl and Rose::DB Postgres Transactions

I've been struggling with this problem all day.. thought I would ask here, before I loose all my hair. Description I'm using Perl 5.10.1 with Rose::DB and PostgreSQL 8.4 (on Debian Linux). I need some changes to my "trans" objects to be within a…
ritter
  • 555
  • 4
  • 13
1
vote
0 answers

RoseDB error on trying to run .pl script

when I try to run this .pl script: \#!/usr/bin/perl use strict; use abc::abcBill; use abc::abcBill::Manager; abc::abcBill::Manager->update_abcBill( set => { mb_status=>'Purged' }, where=>[ mb_created_date => { ls => '2012-05-01 00:00:00' }…
rsharma
  • 75
  • 1
  • 9
1
vote
1 answer

PERL | Blessed object in hash | Rose::DB::Object

I'm trying to figure out why I cannot access a blessed reference inside of an element: This is my module: package Test::Node __PACKAGE__->meta->setup( table => 'node', columns => [ id => { type =>…
1
2