Workflo...eratedId(3)

πŸ“¦
version 2.09 Β· 2 versions
, in fedora 44

🌸 Workflow::Persister::DBI::AutoGeneratedId 🌸

okay bestie, welcome to Workflow::Persister::DBI::AutoGeneratedId(3) β€” a User Contributed Perl Documentation page, and it's giving "the database makes the IDs, I just go get them". no cap.


✨ VERSION ✨

this doc describes version 2.09 of this package. iconic behavior honestly.


πŸŽ€ SYNOPSIS πŸŽ€

 persister:
 - name: MyPersister
   dsn: DBI:mysql:database=foo
   ...

like... that's the whole vibe. you set it up, it handles the ID nonsense for you πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

the whole point of this class: be able to pull an ID from a database handle or a statement handle, OR call a DBI function to get the value. three routes, one goal, main character energy fr fr.

🌟 Properties 🌟

from_handle

if you wanna pull the value from a handle, you gotta specify either 'database' or 'statement' to say which handle we're pulling from. and you must also set a value for 'handle_property'. for example β€” if you're on MySQL, this would be 'database'. (MySQL girlies, that's your lane 🫢)

handle_property

the property to pull from the handle you named in 'from_handle'. example: on MySQL this would be 'mysql_insertid'. yes ma'am, that's the one.

func_property

the property you pass to the DBI BAqfunc() call so it hands back the ID value. example: on SQLite this would be 'last_insert_rowid'. SQLite besties rise 😭✨


πŸ‘‘ ATTRIBUTES πŸ‘‘

log

holds the logger object that's associated with this instance. that's it. that's the attribute. very demure, very mindful.


πŸ’– METHODS πŸ’–

new ( \%params )

this method instantiates a class for retrieval of auto-generated ids from a DBI based persistance entity.

it takes a hashref containing keys that match the properties outlined in the section above β€” or it throws Workflow::Exceptions if those aren't defined. so like, define your stuff, okay? πŸ™ˆ

returns an instantiated object upon success. slay.

pre_fetch_id

this is a dummy method, use "post_fetch_id" instead. not me showing up to the function with nothing to do πŸ’€

post_fetch_id

returns a unique sequence id from a database. this is the girl.

takes a two parameters, a DBI database handle and a statement handle.

returns a single value, a integer representing a sequence id from the provided database handle, based on the statement handle.


Copyright (c) 2003-2021 Chris Winters. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Please see the LICENSE


⭐ AUTHORS ⭐

Please see Workflow


πŸ’œ and that's the page bestie! no notes, periodt.

okay so the source/version-and-date tea at the bottom: this is from perl v5.42.0, dated 2026-01-17, and the page itself is Workflo...eratedId(3) πŸŽ€πŸ¦‹ go forth and fetch those IDs πŸ’…

πŸ“¦ where this page comes from