DBSche...:SQLite(3pm)

✨ NAME ✨

DBIx::DBSchema::DBD::SQLite β€” the SQLite-native driver for DBIx::DBSchema, bestie πŸ’–

Like, this is from the User Contributed Perl Documentation section, under the manual page name DBSche...:SQLite(3pm). Yeah the name got mangled, we don't talk about it πŸ™ˆ


🌸 SYNOPSIS 🌸

use DBI; use DBIx::DBSchema;

$dbh = DBI->connect('dbi:SQLite:tns_service_name', 'user','pass');
$schema = new_native DBIx::DBSchema $dbh;

okay so that's literally all you need, no cap. Connect, then new_native it. Slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

This module implements a SQLite-native driver for DBIx::DBSchema. It's giving "glue code that Just Works" and honestly we're obsessed. ✨


πŸ‘‘ AUTHORS πŸ‘‘

Iconic behavior from both of them fr fr 🫢


πŸ’œ API πŸ’œ

πŸŽ€ columns CLASS DBI_DBH TABLE

Give it an actual live DBI database handle and it hands you back a listref of listrefs (peep perllol if that's new to you). Every inner listref has six elements, in this exact order:

  1. column name
  2. column type
  3. nullability
  4. column length
  5. column default
  6. a field reserved for driver-specific use β€” and for sqlite, that field is whether this col is a primary key πŸ”‘

Six elements, six little besties, all in a row. Periodt.

πŸŽ€ primary_key CLASS DBI_DBH TABLE

Hand it an active DBI database handle and it returns the primary key for the table you specified. That's it, that's the whole vibe. πŸ”‘

πŸŽ€ unique CLASS DBI_DBH TABLE

Give it an active DBI database handle, get back a hashref of unique indices. The keys of that hashref are the index names, and the values are arrayrefs pointing at a list of column names for each one. Peep "HASHES OF LISTS" in perlsc and DBIx::DBSchema::ColGroup for the full lore πŸ“š

πŸŽ€ index CLASS DBI_DBH TABLE

Same energy as unique, except this one's for the non-unique indices. Active DBI database handle goes in, a hashref comes out. Keys = index names, values = arrayrefs pointing at a list of column names for each. Again, see "HASHES OF LISTS" in perldsc and DBIx::DBSchema::ColGroup πŸ‘‘

ngl, unique and index are basically twins β€” one's just the unique one and one's the non-unique one. Don't mix them up, bestie 😭

and that's the whole page, you ate it up bestie πŸ’…βœ¨

This one's from perl v5.36.0, dated 2022-09-10, and it lives under DBSche...:SQLite(3pm) in the User Contributed Perl Documentation. Stan a classic. πŸŒˆπŸ’–

πŸ“¦ where this page comes from