No subject


Sun Nov 20 20:48:46 GMT 2022


```
I switched the queue of this bug, as it is S::L's problem, not CAG's.
You are confusing the ability to have columns with any name, with the
ability to create an arbitrary accessor name. You may not do the later
in perl (at least not normally) - every accessor must* conform to
/\A[A-Z_a-z][0-9A-Z_a-z]*\z/.

This is not only limited to numbers - S::L has a general deficiency in
constructiong accessor names. It has been argued for several years that
S::L must sanitycheck all resulting accessor names and specify 'accessor
=> undef' for anything that seems out of line. Sadly the former
maintainer was extremely uncooperative on this problem.

So two courses of action:
Long term  _default_column_accessor_name() needs a facelift to stop
asking the system to create accessors with illegal names (patches very
very very welcome).
Short term all you need to do is provide a custom column naming callback
via
https://metacpan.org/module/DBIx::Class::Schema::Loader::Base#col_accessor_map

In the meantime I will have to re-relase a CAG with the ability to
shutoff the check via an envvar. Creating broken accessor names however
will not be the default mode of operation.

Cheers

* The "must" here is a little ambiguous. One of course can always do
$obj->${\"666 random crap of a name"}, but one can never do 'sub
666_haha { ... }'. Since the job of CAG is to make generally accessible
accessors (haha), there is little argument in allowing weird naming.
Especially given the workaround availability as stated above.
```



More information about the DBIx-Class-Devel mailing list