dbix-class Questions

1

For any given result class MySchema::Result::Foo (built from default schema loader generated syntax which uses Moose/MooseX::nonmoose) If I add a BUILDARGS method wrapper to sanitize the construc...
Flinger asked 7/12, 2010 at 14:28

2

In the application I am building, users can specify relationships between tables. Since I only determine this at runtime, I can't specify has_many or belongs_to relationships in the schema module...
Formate asked 13/2, 2010 at 1:28

3

Solved

What is the best way to deal with exceptions threw in a method chaining in Perl? I want to assign a value of 0 or undef if any of the methods chained throw an exception Code sample: my $x = $obj-...
Activist asked 15/8, 2011 at 12:36

6

Solved

Summary I've got a table of items that go in pairs. I'd like to self-join it so I can retrieve both sides of the pair in a single query. It's valid SQL (I think), the SQLite engine actually does a...
Neille asked 10/6, 2009 at 22:25

1

I am trying to create a sqlite3 database as a test environment that mimics the production environment. Due to the way production is setup the tables are in multiple schemas. I have setup the class...
Livonia asked 15/7, 2011 at 5:49

2

Solved

Using DBIx::Class and I have a resultset which needs to be filtered by data which cannot be generated by SQL. What I need to do is something effectively equivalent to this hypothetical example: my...
Cromagnon asked 7/11, 2008 at 9:2

3

Solved

Setting the DBIC_TRACE environment variable to true: BEGIN { $ENV{DBIC_TRACE} = 1 } generates very helpful output, especially showing the SQL query that is being executed, but the SQL query is a...
Cyndi asked 17/2, 2009 at 12:31

2

I'd like to pretty-print DBIx::Class::ResultSet results like this: my $schema = MyDatabase::Main->connect('dbi:SQLite:db/example.db'); my $rs = $schema->resultset('Track')->all() # then p...
Hotblooded asked 27/10, 2010 at 17:27

1

Solved

I've got the following code: package MyPackage::ResultSet::Case; use base 'DBIx::Class::ResultSet'; sub cases_last_fourteen_days { my ($self, $username) = @_; return $self->search({ usern...
Galacto asked 25/11, 2010 at 19:39

3

Solved

I am trying to figure out which module in my CGI::Application is loading Moose. I attempted to overload "require" but I don't seem to have the syntax quite right. If someone could clean up the foll...
Electroanalysis asked 28/9, 2010 at 17:26

2

I am new to Moose and am trying to use it with DBIx::Class. Basic DBIC querying and updating work find, but any trigger I attempt to write does not get executed when I modify an attribute. use Mod...
Warrenwarrener asked 5/3, 2010 at 21:22

2

Solved

We have a link table that can handle multiple types of object on one side, and I can't work out how to get from one of these objects to the link table using has_many. Example: link table contains:...
Zink asked 23/2, 2009 at 10:43

4

Solved

Given a DBIx::Class resultset, for example: my $rs = $c->model("DB::Card")->search({family_name => "Smith"}); the tutorials I've read use the stash to pass an arrayref of rows: $c->...
Downwash asked 15/1, 2009 at 15:59

3

It seems kind of a pain to have my Moose classes. Then to use DBIx::Class to get a result set..then to manually map my result set to the moose classes.
Benefit asked 18/2, 2010 at 19:47

1

Solved

Let's suppose I have a the following simplified example database consisting of three tables: CREATE TABLE people ( person_id INTEGER PRIMARY KEY, person_name VARCHAR(100) ); CREATE TABLE events...
Mehalek asked 18/2, 2010 at 18:7

© 2022 - 2024 — McMap. All rights reserved.