Workflow::Persister::DBI::AutoGeneratedId - Pull IDs from databases that autogenerate them
This documentation describes version 1.62 of this package
<persister name="MyPersister" dsn="DBI:mysql:database=foo" ...
Be able to pull an ID from a database or statement handle, or call a DBI function to get the value.
from_handle
If you want to pull the value from a handle specify either 'database' or 'statement' to specify what handle to pull it from. You must also specify a value for 'handle_property'. For example, if you are using MySQL this would be 'database'.
handle_property
Property to pull from handle specified in 'from_handle'. For example, if you are using MySQL this would be 'mysql_insertid'.
func_property
Property to pass to the DBI 'func()' call to return the ID value. For example, if you are using SQLite this would be 'last_insert_rowid'.
Contains the logger object associated with this instance.
This method instantiates a class for retrieval of auto-generated ids from a DBI based persistance entity.
It takes a hashref containing keys matching the properties outlines in the section above or throws Workflow::Exceptions if these are not defined.
Returns instantiated object upon success.
This is a dummy method, use "post_fetch_id"
Returns a unique sequence id from a database.
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-2023 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
Please see Workflow
To install Workflow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Workflow
CPAN shell
perl -MCPAN -e shell install Workflow
For more information on module installation, please visit the detailed CPAN module installation guide.