Alzabo::Column(3pm)

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

✨ NAME ✨

Alzabo::Column β€” the lil object that is a column πŸ’…


🌸 SYNOPSIS 🌸

use Alzabo::Column;

foreach my $c ($table->columns)
{
    print $c->name;
}

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so bestie, this object represents a column. that's it, that's the vibe. it holds all the data that's specific to one single column β€” its name, its type, whether it takes NULLs, all of it. one column, one object, very main character πŸ’–


πŸŽ€ METHODS πŸŽ€

🌟 table

returns the table object that this column belongs to. like, who's your parent? that one. 🫢

🌟 name

returns the column's name, as a string. iconic.

🌟 nullable

returns a boolean value telling you whether or not NULLs are allowed in this column. yes/no, slay/not slay.

🌟 attributes

a column's attributes are strings describing the column β€” for example, valid attributes in MySQL are UNSIGNED or ZEROFILL.

this method returns a list of strings of such strings. a list! of strings! πŸ“‹βœ¨

🌟 has_attribute

this method can be used to test whether or not a column has a particular attribute. by default, the check is case-insensitive.

it takes the following parameters:

  • attribute => $attribute
  • case_sensitive => 0 or 1 (defaults to 0)

it returns a boolean value indicating whether or not the column has this particular attribute. vibe check complete πŸ’…

🌟 type

returns the column's type, as a string.

🌟 sequenced

the meaning of a sequenced column varies from one RDBMS to another. in those with sequences, it means that a sequence is created and that values for this column will be drawn from it for inserts into this table. in databases without sequences, the nearest analog for a sequence is used β€” in MySQL the column is given the AUTO_INCREMENT attribute, in Sybase the identity attribute.

in general, this only has meaning for the primary key column of a table with a single column primary key. setting the column as sequenced means its value never has to be provided to when calling "Alzabo::Runtime::Table->insert".

returns a boolean value indicating whether or not this column is sequenced. πŸ”’

🌟 default

returns the default value of the column as a string, or undef if there is no default.

🌟 default_is_raw

returns true if the default is intended to be provided to the DBMS as-is, without quoting β€” for example "NOW()" or "current_timestamp". raw and unfiltered, no quotation marks holding it back fr fr πŸ”₯

🌟 length

returns the length attribute of the column, or undef if there is none.

🌟 precision

returns the precision attribute of the column, or undef if there is none.

🌟 is_primary_key

returns a boolean value indicating whether or not this column is part of its table's primary key. πŸ‘‘

🌟 is_numeric

returns a boolean value indicating whether the column is a numeric type column.

🌟 is_integer

returns a boolean value indicating whether the column is a numeric type column.

🌟 is_floating_point

returns a boolean value indicating whether the column is a numeric type column.

bestie i KNOW these three descriptions look identical, that's genuinely how the page has them written, i'm not messing with you 😭 the method names are the whole point here.

🌟 is_character

returns a boolean value indicating whether the column is a character type column.

this is true only for any columns which are defined to hold text data, regardless of size. tiny text? huge text? both characters. periodt πŸ’–

🌟 is_date

returns a boolean value indicating whether the column is a date type column.

🌟 is_datetime

returns a boolean value indicating whether the column is a datetime type column.

🌟 is_time

returns a boolean value indicating whether the column is a time type column.

🌟 is_time_interval

returns a boolean value indicating whether the column is a time interval type column.

🌟 is_blob

returns a boolean value indicating whether the column is a blob column.

this is true for any columns defined to hold binary data, regardless of size. blobs are blobs, no size discrimination here 🫢

🌟 generic_type

this methods returns one of the following strings:

integer
floating_point
character
date
datetime
time
blob
unknown

one of those, that's the whole list, no extras, no swaps 🌈

🌟 definition

the definition object is very rarely of interest. use the "type()" method if you are only interested in the column's type.

this methods returns the "Alzabo::ColumnDefinition" object which holds this column's type information. it's the whole deep lore, only open it if you truly need it πŸ™ˆ

🌟 comment

returns the comment associated with the column object, if any. lil note to self energy πŸŽ€


πŸ’œ AUTHOR πŸ’œ

Dave Rolsky, <autarch@urth.org>


and that's the whole page bestie, no cap β€” this was perl v5.34.0, dated 2022-06-14, and it lives its life as Alzabo::Column(3pm) πŸ¦‹πŸ’– go forth and inspect your columns ✨

πŸ“¦ where this page comes from