Wiki::...SQLite(3pm)

πŸ“¦
version 0.86 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Okay so bestie, listen β€” this is Wiki::Toolkit::Setup::SQLite, the little module whose whole entire job is setting up tables for a Wiki::Toolkit store in a SQLite database. That's it. That's the gig. She's the setup crew, not the main character. πŸ’…

(The manual name is Wiki::...SQLite(3pm), and yeah β€” it's from the User Contributed Perl Documentation collection, iykyk.)


✨ SYNOPSIS ✨

use Wiki::Toolkit::Setup::SQLite;
Wiki::Toolkit::Setup::SQLite::setup( $dbfile );

That's the whole vibe. Two lines. Load her, call her, done. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

Literally just: set up a SQLite database so it can be used as a Wiki::Toolkit store. No cap. She makes the tables so your wiki can live its truth. 🌸


πŸ”₯ FUNCTIONS πŸ”₯

πŸ’« setup

use Wiki::Toolkit::Setup::SQLite;

Wiki::Toolkit::Setup::SQLite::setup( $filename );

or, alternatively, the database-handle way:

Wiki::Toolkit::Setup::SQLite::setup( $dbh );

She takes one argument β€” and that argument is either the name of the file that the SQLite database is stored in, or an active database handle. Pick your fighter. 🫢

⚠️ NOTE: if a table that the module wants to create already exists, setup will leave it alone. Good news actually β€” that means you can safely run this on an existing Wiki::Toolkit database to bring the schema up to date with the current Wiki::Toolkit version. πŸŽ‰ But if you want to completely start again with a fresh database, run cleardb first. Okurrr.

There's also an optional second argument you may pass, specifying the schema version to use. Read this carefully bestie: this is ONLY intended to be used during unit testing and should not normally be specified. Like, at all. Ngl, don't touch it. πŸ™ˆ

πŸ’€ cleardb

use Wiki::Toolkit::Setup::SQLite;

# Clear out all Wiki::Toolkit tables from the database.
Wiki::Toolkit::Setup::SQLite::cleardb( $filename );

or:

Wiki::Toolkit::Setup::SQLite::cleardb( $dbh );

Takes one argument β€” same deal as before: either the name of the file that the SQLite database is stored in, or an active database handle.

She clears out all Wiki::Toolkit store tables from the database.

😭 NOTE: this will lose all your data. Like, all of it. You probably only want to use this for testing purposes or if you really screwed up somewhere. Fr fr, tread lightly.
🧚 Also note: she does not touch any Wiki::Toolkit search backend tables. So if you've got any of those in the same database β€” or a different one, honestly β€” go see Wiki::Toolkit::Setup::DBIxFTS or Wiki::Toolkit::Setup::SII, depending on which search backend you're using. Different module, different job, periodt.

πŸ‘‘ ALTERNATIVE CALLING SYNTAX πŸ‘‘

As requested by Podmaster. Instead of passing arguments to the methods as

($filename)

you can pass them as

( { dbname => $filename } )

or indeed

( { dbh => $dbh } )

⚠️ And note β€” that's a hashref, not a hash. Do not come in here with a plain hash, bestie, she will not know what to do with it. πŸ’…


🌈 AUTHOR 🌈

Kake Pugh (kake@earth.li). Iconic. ⭐


Copyright (C) 2002-2004 Kake Pugh.  All Rights Reserved.
Copyright (C) 2006-2009 the Wiki::Toolkit team. All Rights Reserved.

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


πŸŽ€ SEE ALSO πŸŽ€

  • Wiki::Toolkit
  • Wiki::Toolkit::Setup::DBIxFTS
  • Wiki::Toolkit::Setup::SII

Go read those too, bestie, they're the rest of the lore. πŸ“š


Alright, that's the whole page! Mwah. πŸ’– This one's perl v5.32.0, dated 2021-01-04, and it's the Wiki::...SQLite(3pm) page from the User Contributed Perl Documentation β€” go forth and set up your tables, you've got this. πŸ¦‹βœ¨

πŸ“¦ where this page comes from