Jifty:...Column(3pm)

πŸ“¦
version 0.78 Β· 2 versions
  • 0.78 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.78 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Jifty::...Column πŸ’–

okay bestie, gather round, because this one is literally the User Contributed Perl Documentation for Jifty::DBI::Column and it's giving "small class, big responsibilities" πŸŽ€


✨ NAME ✨

Jifty::DBI::Column β€” encapsulates a single column in a Jifty::DBI::Record table. one column, one whole little diva, no cap πŸ’…


🌸 DESCRIPTION 🌸

So this class is the glow-up for a single column inside a Jifty::DBI::Record table description. It replaces the _accessible method in Jifty::DBI::Record, which is iconic of it honestly.

It's got these accessors, and yes you're gonna memorize them: name type default validator boolean refers_to readable writable length ✨

πŸ¦‹ new

(no notes, bestie, it's just new β€” the constructor does constructor things 🫢)

πŸ¦‹ is_numeric

Returns true if the column is some kind of numeric type, otherwise it returns false. that's it. that's the whole vibe πŸ”’

πŸ¦‹ is_string

Returns true if this column is a text field πŸ“

πŸ¦‹ is_boolean

Returns true if this column is a boolean βœ…

πŸ¦‹ serialize_metadata

Returns a hash describing this column object with enough detail to fully describe it in the database.

It intentionally skips:

  • record_class
  • all column attributes starting with _
  • all column attributes which are undefined

The "known" attributes in the attributes hash get flattened and returned as well. The list of known attributes is:

  • container
  • label hints render_as
  • display_length
  • valid_values
  • available_values
  • autocompleted
  • documentation
  • no_placeholder

🧚 no_placeholder

Setting this to a true value causes load_by_cols in Jifty::DBI::record to not use a placeholder when loading the column. This can allow the database to come up with better query plans in some cases. lowkey a performance slay πŸ‘‘

πŸ¦‹ serialize_metadata2

Returns a hash describing this column object with enough detail to fully describe it in the database. (yes, the sequel πŸ’–)

It intentionally skips:

  • record_class
  • all column attributes starting with _
  • all column attributes which are undefined

and that's the whole rundown, bestie.

πŸ¦‹ validator

Gets/sets the validator coderef for the column. give it a coderef, get a coderef, mutual exchange, it's giving communication 🫢

πŸ¦‹ read

DEPRECATED. Use $column->readable instead. 🚨 like bestie it's over, move on 🚨

πŸ¦‹ write

DEPRECATED. Use $column->writable instead. 🚨 stop using it fr fr 🚨

πŸ¦‹ length

DEPRECATED. Use $column->max_length instead. 🚨 she's retired, respect the retirement 🚨

πŸ¦‹ until

DEPRECATED. Use $column->till instead. 🚨 literally just rename it in your code, i'm begging 🚨

πŸ¦‹ active

Returns a true value if the column method exists for the current application version. The current application version is figured out by checking the schema_version in Jifty::DBI::Record of the column's record_class.

This method returns a false value if the column has not yet been added or has been dropped.

And it also returns a false value under these circumstances:

  • Both the since trait and schema_version method are defined, and schema_version is less than the version set on since.
  • Both the till trait and schema_version method are defined, and schema_version is greater than or equal to the version set on till.

Otherwise, this method returns true. periodt. πŸ’…


🌈 vibe check complete: every option, every deprecated warning, every known attribute β€” all accounted for. nothing dropped, nothing invented, we ate and left no crumbs πŸ‘‘

and that's a wrap bestie!! this page is from perl v5.34.0, dated 2022-06-15, and it ships as part of the Jifty:...Column(3pm) manual β€” mwah, go forth and query responsibly πŸ’œπŸŒΈ

πŸ“¦ where this page comes from