DBSchema::Index(3pm)

πŸ’– DBSchema::Index πŸ’–

okay bestie so this is a page from the User Contributed Perl Documentation, and it's literally about DBIx::DBSchema::Index β€” the little object that holds one single database index. slay.


✨ NAME ✨

DBIx::DBSchema::Index β€” Index objects. that's it. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSYS πŸ¦‹

(it's spelled like that in the original, don't @ me πŸ’€) here's the whole thing verbatim, no notes:

use DBIx::DBSchema::Index;

$index = new DBIx::DBSchema::Index (
  {
  }
);

iconic. empty hashref. main character energy. πŸ’…


🌸 DESCRIPTION 🌸

so like, a DBIx::DBSchema::Index object represents a unique or non-unique database index. that's literally the whole job. it's giving very focused, very demure, very mindful. 🫢


πŸ‘‘ METHODS πŸ‘‘

new HASHREF | OPTION, VALUE, ...

Creates a new DBIx::DBschema::Index object. ✨

ngl it's flexible β€” it accepts either a hashref or a list of options and values. your choice, bestie, both are valid. πŸ’–

the options are:

  • name β€” Index name
  • using β€” Optional index method
  • unique β€” Boolean indicating whether or not this is a unique index.
  • columns β€” List reference of column names (or expressions)

name [ INDEX_NAME ]

Returns or sets the index name. renaming? slay. πŸŽ€

using [ INDEX_METHOD ]

Returns or sets the optional index method. (optional optional, we love a low-commitment queen.) πŸ’…

unique [ BOOL ]

Returns or sets the unique flag. yes/no, iconic behavior only. πŸ”₯

columns [ LISTREF ]

Returns or sets the indexed columns (or expressions). expressions?? we love a flexible listref. πŸ¦‹

columns_sql

Returns a comma-joined list of columns, suitable for an SQL statement. she's ready for the group project fr fr. πŸ’œ

sql_create_index TABLENAME

Returns an SQL statment to create this index on the specified table. give her a table name and she's off. ✨

(yes, "statment" β€” that's the original's spelling, keeping it exact, no cap. 😭)

cmp OTHER_INDEX_OBJECT

Compares this object to another supplied object. Returns true if they are identical, or false otherwise. full-on twin check. πŸ‘€

cmp_noname OTHER_INDEX_OBJECT

Compares this object to another supplied object. Returns true if they are identical, disregarding index name, or false otherwise. same energy, name excluded, we don't care what she's called. 🫢


πŸ’œ AUTHOR πŸ’œ

Ivan Kohler <ivan-dbix-dbschema@420.am>

Copyright (c) 2007 Ivan Kohler Copyright (c) 2007 Freeside Internet Services, Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

(so like β€” legally speaking, same terms as Perl itself. free software bestie behavior. 🌈)


πŸ’€ BUGS πŸ’€

Is there any situation in which sql_create_index needs to return a list of multiple statements?

genuinely asking. open question. if you know, you know (iykyk). πŸ™ˆ


πŸ“ SEE ALSO πŸ“

  • DBIx::DBSchema::Table
  • DBIx::DBSchema
  • DBI

go read those next, bestie, it's a whole cinematic universe. 🧚


okay that's the whole page!! this came from perl v5.36.0, dated 2022-09-10, and it belongs to DBSchema::Index(3pm). mwah, go build some indexes. πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from