dbix-class Questions

1

Solved

If I already have an active DBI database handle, is there a way to instantiate a DBIx::Class schema using that database handle, rather than creating a new connection, e.g. something like my $schema...
Terle asked 9/9, 2021 at 11:30

2

Solved

I am using Catalyst and DBIx::Class::Schema::Loader to create my model in Catalyst like so: script/myapp_create.pl model DB DBIC::Schema MyApp::Schema create=static overwrite_modifications=1 compo...
Teage asked 31/1, 2011 at 11:22

1

Solved

Here are three tables: product, model, and product_model that maps products and models in N:M relationship. product product_model model id name product_id model_id id name ------------ ----------...
Designing asked 18/12, 2017 at 2:28

1

Solved

I'm working in a bioinformatics project that requires me to read genomic data (nothing too fancy, just think of it as strings) from various organisms and insert it into a database. Each read belong...
Jasperjaspers asked 7/7, 2017 at 15:44

4

Solved

I'm using DBIx::Class in my perl script to interact with a sqlite database. When doing inserts/searches, what will DBIx::Class consider 'true' and 'false'? eg: $schema->resultset('SomeObject'...
Awildaawkward asked 25/9, 2012 at 22:51

1

I am trying to use DBIx:Class. I have successfully created the Schema class using DBIx:class::Schema::Loader. I can also connect to the database. #!/usr/bin/perl -w use Test::More tests => 5; ...
Anthonyanthophore asked 11/10, 2014 at 15:13

1

Solved

I just need to dump specific tables from my database such that these specific tables (3 tables to be exact out of 200 tables) will now be implemented by DBIx::Class::Schema. Here is the command fr...
Shatter asked 2/3, 2016 at 12:52

3

Solved

I have some code which needs to ensure some data is in a mysql enum prior to insertion in the database. The cleanest way I've found of doing this is the following code: sub enum_values { my ( $se...
Postboy asked 23/10, 2008 at 10:11

2

Solved

I'm trying to convert some raw DBI calls to DBIx::Class. I occasionally run across something like: UPDATE 'foo' SET bar = bar + 1 WHERE ... Is there way to do have DBIx::Class execute exactly th...
Urian asked 7/11, 2014 at 18:10

4

Solved

In the C#/.Net world, there are ORMs such as NHibernate or ActiveRecord that includes transparent caching: database updates are transparently replicated to the cache, objects are retrieved directly...
Optimal asked 12/8, 2009 at 18:4

1

Solved

I want to retrieve rows from a table with DBIx::Class and prefetch respective rows from the same table where a column has a particular other value. I need to fetch all assignments from schedule A (...
Probst asked 30/7, 2014 at 16:59

1

Solved

Please show me how to generate SQL schema from my Perl DBIx::Class files ? Basically the reverse of make_schema_at in DBIx::Class::Schema::Loader. I have already built the Perl schema files, I ju...
Parquetry asked 3/6, 2014 at 12:51

2

Solved

I found it rather difficult to find information about how to assemble a DBIx::Class schema structure using Moose. How to do that correctly (essentially working) and in modern Perl (good style, fast...
Fun asked 18/3, 2014 at 15:1

1

Solved

Finding the table name for a class in DBIx::Class is straightforward, like this my $s = DBIx::Class::Schema::Loader->connect('dbi:SQLite:foo.db'); $s->class($class_name)->table; but how...
Bigotry asked 16/3, 2014 at 14:49

3

Solved

For historical reasons, we have a table at work that has integer values in a text field that correspond to the ID's in another table. Example: CREATE TABLE things ( id INTEGER, name VARCHAR, th...
Tuscarora asked 19/9, 2013 at 21:23

2

Solved

I haven't found a way to do unions with DBIx::Class other than using a view and writing out the SQL manually. This seems strange to me. I feel like there should be some way to union two ResultSets ...
Aphrodite asked 26/10, 2011 at 8:1

3

I'm currently trying to implement the following scenario with DBIx: The table products contains "general products" and "bundle products" (bundle products are collections of general products): pac...
Hubey asked 11/10, 2012 at 16:51

2

Solved

I'm using DBIx::Class in a Catalyst app I am building. It works great, but sometimes I need to use my own db functions that I've developed that are very specific to my needs. Because of this, I nee...
Pied asked 6/2, 2013 at 1:16

3

Solved

We are currently introducing DBIx::Class in our team and we would like to start out with DBIx::Class::Schema::Loader. However, we have hard requirements on code style, i.e. we've got Perl::Tidy as ...
Parlor asked 20/1, 2010 at 14:54

2

Solved

Data defined inside Catalyst app or in templates has correct encoding and is diplayed well, but from database everything non-Latin1 is converted to ?. I suppose problem should be in model class, wh...
Miscellaneous asked 30/10, 2012 at 12:11

2

Solved

I do not think I understand the scope of DBIx::Class Do I have to manually create a database with regular SQL first, then use the schemaloader (or manually code the schema/resultsets)? Or is there ...
Earthshaker asked 9/10, 2012 at 9:12

1

Solved

I've got two tables, book and language; book belongs_to language by having a language column stating which language it's in. The language table is just the language column. I want to do $book->...
Technology asked 9/8, 2012 at 22:42

3

Solved

Does anyone know what's the DBIx::Class equivalent of an SQL query such as: SELECT cdr_id, CASE WHEN service_id = 'GPRS' THEN 'KB' WHEN service_id = 'SMS' THEN 'SMS' END AS unit FROM ... Thanks ...
Dimphia asked 8/2, 2012 at 19:11

2

Solved

I'm getting my feet wet in DBIx::Class — loving it so far. One problem I am running into is that I want to query records, filtering out records that aren't in a certain date range. It took ...
Bedouin asked 11/3, 2010 at 16:49

2

Solved

From the documentation for find_or_create: Note: Because find_or_create() reads from the database and then possibly inserts based on the result, this method is subject to a race condition. Ano...
Prodigious asked 21/4, 2012 at 23:44

© 2022 - 2024 — McMap. All rights reserved.