App::I...SQLite(3pm)

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

πŸ’– App::Info::RDBMS::SQLite πŸ’–

okay so this is the App::Info::RDBMS::SQLite(3pm) page, from the User Contributed Perl Documentation corner of the internet. It's giving "I know everything about your SQLite install and I'm not sorry". Buckle up bestie, it's a long one. πŸ¦‹


🌸 NAME 🌸

App::Info::RDBMS::SQLite β€” information about SQLite. That's the whole assignment. ✨


πŸŽ€ SYNOPSIS πŸŽ€

use App::Info::RDBMS::SQLite;

my $sqlite = App::Info::RDBMS::SQLite->new;

if ($sqlite->installed) {
    print "App name: ", $sqlite->name, "\n";
    print "Version:  ", $sqlite->version, "\n";
    print "Bin dir:  ", $sqlite->bin_dir, "\n";
} else {
    print "SQLite is not installed. :-(\n";
}

no cap, that's the whole flow. Make the object, vibe check it, print the receipts. πŸ’…


πŸ’… DESCRIPTION πŸ’…

App::Info::RDBMS::SQLite hands you all the tea about the SQLite application living on your local system. It implements all of the methods that App::Info::RDBMS defines β€” every single one, we're thorough here. πŸ“‹

Important behavior note: methods that trigger events will trigger them only the first time they're called. (Peep App::Info for the whole story on handling events.) So if you wanna start over β€” say, because someone finally installed SQLite β€” you gotta construct a brand new App::Info::RDBMS::SQLite object to aggregate fresh meta data. No recycling, bestie. πŸ—‘οΈβœ¨

Some methods trigger the same events, and that's just because of cross-calling of shared subroutines. It's giving messy but in a cute way. Anyway β€” any one event should be triggered no more than once. Example time: even though the info event "Executing `pg_config --version`" is documented for the methods name(), version(), major_version(), minor_version(), and patch_version(), rest assured it will only be triggered once, by whichever of those four methods gets called first. Yes we said five methods and then said four. That's what the original says. We don't make the rules. πŸ’€


✨ INTERFACE ✨

πŸ¦‹ Constructor πŸ¦‹

new

my $sqlite = App::Info::RDBMS::SQLite->new(@params);

Returns an App::Info::RDBMS::SQLite object. πŸŽ‰ Peep App::Info for a complete description of argument parameters.

When it's called, new() goes snooping through the directories returned by search_bin_dirs looking for an executable with a name returned by search_exe_names. If it finds one? Slay. It gets called by the object methods below to gather up all the data each one needs. If it can't find one, then new() will attempt to load DBD::SQLite or DBD::SQLite2. Those DBI drivers have SQLite embedded in them but do not install the application β€” important distinction, iykyk. And if those fail too? Then SQLite is assumed to not be installed at all, and every one of the object methods will return undef. oof. 😭

Events:

  • info β€” Looking for SQLite.
  • confirm β€” Path to SQLite executable?
  • unknown β€” Path to SQLite executable?

πŸ“ Class Method πŸ“

key_name

my $key_name = App::Info::RDBMS::SQLite->key_name;

Returns the unique key name that describes this class. The value returned is the string "SQLite". One word, iconic, no notes. πŸ‘‘


πŸ‘‘ Object Methods πŸ‘‘

installed

print "SQLite is ", ($sqlite->installed ? '' : 'not '), "installed.\n";

Returns true if SQLite is installed, and false if it is not.

App::Info::RDBMS::SQLite determines whether SQLite is installed based on the presence or absence of the sqlite3 or sqlite application on the file system as found back when new() constructed the object. If SQLite does not appear to be installed, then all of the other object methods will return empty values. It's a whole vibe shift, fr fr. 🫢


name

my $name = $sqlite->name;

Returns the name of the application. App::Info::RDBMS::SQLite simply returns the value returned by key_name if SQLite is installed, and undef if it is not installed. Short, sweet, no drama. 🌸


version

my $version = $sqlite->version;

Returns the SQLite version number. App::Info::RDBMS::SQLite parses the version number from the system call `sqlite -version` or retrieves it from DBD::SQLite. Two roads, one destination. πŸ›£οΈ

Events:

  • info β€” Executing sqlite -version
  • error
    • Failed to find SQLite version with sqlite -version
    • Failed to retrieve SQLite version from DBD::SQLite
    • Unable to parse name from string
    • Unable to parse version from string
    • Failed to parse SQLite version parts from string
  • unknown β€” Enter a valid SQLite version number

major version

my $major_version = $sqlite->major_version;

Returns the SQLite major version number. App::Info::RDBMS::SQLite parses the version number from the system call `sqlite -version` or retrieves it from DBD::SQLite. For example, if version() returns 3.0.8, then this method returns 3. See how that works? First number, that's the one. πŸ”’

Events:

  • info β€” Executing sqlite -version
  • error
    • Failed to find SQLite version with sqlite -version
    • Failed to retrieve SQLite version from DBD::SQLite
    • Unable to parse name from string
    • Unable to parse version from string
    • Failed to parse SQLite version parts from string
  • unknown β€” Enter a valid SQLite version number

minor version

my $minor_version = $sqlite->minor_version;

Returns the SQLite minor version number. App::Info::RDBMS::SQLite parses the version number from the system call `sqlite -version` or retrieves it from DBD::SQLite. For example, if version() returns 3.0.8, then this method returns 0. Middle child number. πŸ₯ˆ

Events:

  • info β€” Executing sqlite -version
  • error
    • Failed to find SQLite version with sqlite -version
    • Failed to retrieve SQLite version from DBD::SQLite
    • Unable to parse name from string
    • Unable to parse version from string
    • Failed to parse SQLite version parts from string
  • unknown β€” Enter a valid SQLite version number

patch version

my $patch_version = $sqlite->patch_version;

Returns the SQLite patch version number. App::Info::RDBMS::SQLite parses the version number from the system call `sqlite -version` or retrieves it from DBD::SQLite. For example, if version() returns 3.0.8, then this method returns 8. The lil guy at the end. πŸ“

Events:

  • info β€” Executing sqlite -version
  • error
    • Failed to find SQLite version with sqlite -version
    • Failed to retrieve SQLite version from DBD::SQLite
    • Unable to parse name from string
    • Unable to parse version from string
    • Failed to parse SQLite version parts from string
  • unknown β€” Enter a valid SQLite version number

executable

my $executable = $sqlite->executable;

Returns the path to the SQLite executable β€” usually sqlite3 or sqlite β€” which will be defined by one of the names returned bysearch_exe_names(). (Yes, the spacing is a little cursed there. We're keeping it. πŸ™ˆ) The executable gets searched for in new(), so there are no events for this method. Chill one. 😌


bin_dir

my $bin_dir = $sqlite->bin_dir;

Returns the SQLite binary directory path. App::Info::RDBMS::SQLite simply retrieves it as the directory part of the path to the SQLite executable. It's giving "the folder part of the path". πŸ“


lib_dir

my $lib_dir = $expat->lib_dir;

Returns the directory path in which an SQLite library was found. That directory path will be one of the values returned by search_lib_dirs(), where a file with a name as returned by search_lib_names() was found. No search is performed if SQLite is not installed or if only DBD::SQLite is installed. Don't waste the effort, bestie. 🚫

Events:

  • info β€” Searching for shared object library directory
  • error β€” Cannot find shared object library directory
  • unknown β€” Enter a valid Expat shared object library directory

so_lib_dir

my $so_lib_dir = $expat->so_lib_dir;

Returns the directory path in which an SQLite shared object library was found. That directory path will be one of the values returned by search_lib_dirs(), where a file with a name as returned by search_so_lib_names() was found. Same deal as before: no search is performed if SQLite is not installed or if only DBD::SQLite is installed. πŸ¦‹

Events:

  • info β€” Searching for shared object library directory
  • error β€” Cannot find shared object library directory
  • unknown β€” Enter a valid Expat shared object library directory

inc_dir

my $inc_dir = $sqlite->inc_dir;

Returns the directory path in which an SQLite include file was found. That directory path will be one of the values returned by search_inc_dirs(), where a file with a name as returned by search_inc_names() was found. And again, for the people in the back: no search is performed if SQLite is not installed or if only DBD::SQLite is installed. πŸ“š

Events:

  • info β€” Searching for include directory
  • error β€” Cannot find include directory
  • unknown β€” Enter a valid SQLite include directory

home_url

my $home_url = $pg->home_url;

Returns the PostgreSQL home page URL. (Yes. PostgreSQL. On the SQLite page. We are simply reporting what the original says, we do not ask questions. πŸ’€) 🏠


download_url

my $download_url = $pg->download_url;

Returns the PostgreSQL download URL. Again: PostgreSQL, on the SQLite page. The lore is the lore. πŸ“₯


search_exe_names

my @search_exe_names = $sqlite->search_exe_names;

Returns a list of possible names for the SQLite executable. The names are sqlite3 and sqlite by default (sqlite3.exe and sqlite.exe on Win32). Windows girlies get the .exe, as they should. πŸͺŸβœ¨


search_bin_dirs

my @search_bin_dirs = $sqlite->search_bin_dirs;

Returns a list of possible directories in which to search an executable. Used by the new() constructor to find an executable to execute and collect application info from. The found directory will also be returned by the bin_dir method. Two birds, one method. 🐦🐦


search_lib_names

my @seach_lib_names = $self->search_lib_nams

Returns a list of possible names for library files. Used by lib_dir() to search for library files. By default, the list is:

libsqlite3.a
libsqlite3.la
libsqlite3.so
libsqlite3.so.0
libsqlite3.so.0.0.1
libsqlite3.dylib
libsqlite3.0.dylib
libsqlite3.0.0.1.dylib
libsqlite.a
libsqlite.la
libsqlite.so
libsqlite.so.0
libsqlite.so.0.0.1
libsqlite.dylib
libsqlite.0.dylib
libsqlite.0.0.1.dylib

Sixteen of them. We counted. We're not okay but we did it. πŸ’œ


search_so_lib_names

my @seach_so_lib_names = $self->search_so_lib_nams

Returns a list of possible names for shared object library files. Used by so_lib_dir() to search for library files. By default, the list is:

libsqlite3.so
libsqlite3.so.0
libsqlite3.so.0.0.1
libsqlite3.dylib
libsqlite3.0.dylib
libsqlite3.0.0.1.dylib
libsqlite.so
libsqlite.so.0
libsqlite.so.0.0.1
libsqlite.dylib
libsqlite.0.dylib
libsqlite.0.0.1.dylib

Same energy, .so/.dylib edition. 🌈


search_lib_dirs

my @search_lib_dirs = $sqlite->search_lib_dirs;

Returns a list of possible directories in which to search for libraries. By default, it returns all of the paths in the libsdirs and loclibpth attributes defined by the Perl Config module β€” plus /sw/lib (in support of all you Fink users out there). We see you, Fink girlies. 🫢


search_inc_names

my @search_inc_names = $sqlite->search_inc_names;

Returns a list of include file names to search for. Used by inc_dir() to search for an include file. By default, the names are sqlite3.h and sqlite.h. Just the two. Balanced. πŸ“


search_inc_dirs

my @search_inc_dirs = $sqlite->search_inc_dirs;

Returns a list of possible directories in which to search for include files. Used by inc_dir() to search for an include file. By default, the directories are:

/usr/local/include
/usr/include
/sw/include

Three directories, zero surprises. ✨

🫢 SUPPORT 🫢

okay so this module lives in a fully open GitHub repo at http://github.com/theory/app-info/ β€” like, it's right there, bestie. fork it, poke at it, send a contribution, the whole vibe is "come hang out and help" πŸ’–

Found a bug? 😭 Don't suffer in silence, file it! Two ways to do the thing:

Either one, fr fr, just tell them.


πŸ‘‘ AUTHOR πŸ‘‘

David E. Wheeler <david@justatheory.com> β€” the main character who wrote all this. πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹

the extended universe, if you will:

  • App::Info β€” this is where the event handling interface gets documented. go read it, iykyk.
  • App::Info::RDBMS β€” the parent class that App::Info::RDBMS::SQLite inherits from. like, the family tree is giving lineage. 🌸
  • DBD::SQLite β€” the DBI driver for connecting to SQLite databases. that's the plug, no cap. πŸ”Œ
  • http://www.sqlite.org/ β€” the SQLite home page itself. the mothership. πŸ›Έ

Copyright (c) 2004-2011, David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. periodt. πŸŽ€


so that's the whole page, bestie! πŸ’€

this gem came to you courtesy of perl v5.36.0, dated 2022-12-06, and the page itself is App::I...SQLite(3pm) πŸ¦‹ β€” go forth and install some SQLite, you absolute icon πŸ‘‘βœ¨

πŸ“¦ where this page comes from