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

πŸ’– Alzabo::Runtime::Column β€” the glow-up guide πŸ’–

okay bestie, welcome to the Alzabo::Runtime::Column page from the User Contributed Perl Documentation, aka the little manual that tells you everything about column objects. it's giving backstage pass to your database's cutest building block. let's get into it ✨


✨ NAME ✨

Alzabo::Runtime::Column β€” column objects, periodt πŸ’…


🌸 SYNOPSIS 🌸

use Alzabo::Runtime::Column;

that's it, that's the whole vibe check 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so this object is a column. like, it represents one. it holds all the data that's specific to a single column, no cap. it's the main character of one tiny slice of your table πŸ’–


πŸ‘‘ INHERITS FROM πŸ‘‘

Alzabo::Column

heads up bestie: every single piece of relevant documentation from the superclass has been merged straight into this document. so you don't gotta go anywhere else, it's all here πŸŽ€

πŸ’… METHODS πŸ’…

πŸ“ table

returns the table object that this column belongs to. its home, its origin story, its whole situation 🌈

πŸ“ name

returns the column's name, as a string. yes, the actual name. iconic of it ✨

πŸ“ nullable

returns a boolean value telling you whether or not NULLs are allowed in this column. lowkey important, ngl πŸ’€

πŸ“ attributes

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

this method returns a list of strings of such strings. a list of strings of strings?? yes. that's the whole thing πŸ’–

πŸ“ has_attribute

you can use this one to test whether or not a column has one particular attribute. by default, the check is case-insensitive (chill of it, honestly).

it takes these parameters:

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

and it returns a boolean value telling you whether or not the column has that particular attribute 🫢

πŸ“ type

returns the column's type as a string. slay πŸŽ€

πŸ“ sequenced

okay so the meaning of a sequenced column varies from one RDBMS to another. in the ones that have sequences, it means a sequence gets created and 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 instead β€” in MySQL the column gets the AUTO_INCREMENT attribute, and in Sybase it gets 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 when you call Alzabo::Runtime::Table->insert. you just... don't gotta. the universe handles it 🌸

returns a boolean value telling you 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. no default, no problem πŸ¦‹

πŸ“ 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, unfiltered, exactly how the DBMS wants it πŸ’…

πŸ“ 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 telling you whether or not this column is part of its table's primary key. main character column behavior πŸ‘‘

πŸ“ 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 πŸ”’

πŸ“ 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. size doesn't matter here bestie, text is text πŸ’–

πŸ“ 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. again β€” size is not the moment, binary-ness is 🌈

πŸ“ generic_type

this method returns one of the following strings:

  • integer
  • floating_point
  • character
  • date
  • datetime
  • time
  • blob
  • unknown

pick your fighter, the column already picked for you πŸ’«

πŸ“ definition

the definition object is very rarely of interest. use the type() method if you're only interested in the column's type. genuinely, bestie, type() is the one you want 99% of the time πŸ™ˆ

this method returns the Alzabo::Runtime::ColumnDefinition object which holds this column's type information.

πŸ“ comment

returns the comment associated with the column object, if any. if there isn't one, well, there isn't one πŸ’œ

πŸ“ alias

takes the following parameters:

  • as => $name

this method returns an object that you can use in calls to the table and schema select() methods, in order to change the name given to the column if next_as_hash() is called on the Alzabo::DriverStatement returned by the aforementioned select() method. rename her, she's serving a whole new identity ✨


πŸ’– AUTHOR πŸ’–

Dave Rolsky, <autarch@urth.org> 🫢


and that's the page, bestie!! this was perl v5.34.0, dated 2022-06-14, straight from Alzabo...:Column(3pm) β€” go forth and query, you absolute icon πŸ’…πŸŽ€βœ¨

πŸ“¦ where this page comes from