[perl5-dbi/dbi] 41613e: Allow to call $dbh->last_insert_id() method withou...

----==_mimepart_5afc61a6c3c6d_14042af69b6b3c1477417
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

  Branch: refs/heads/master
  Home:   https://github.com/perl5-dbi/dbi
  Commit: 41613e73cc06b400425cb2c28ebab999404d1d3e
      https://github.com/perl5-dbi/dbi/commit/41613e73cc06b400425cb2c28ebab999404d1d3e
  Author: Pali <pali@cpan.org>
  Date:   2018-04-27 (Fri, 27 Apr 2018)

  Changed paths:
    M DBI.pm
    M Driver.xst

  Log Message:
  -----------
  Allow to call $dbh->last_insert_id() method without arguments

Some databases ignores all arguments passed to $dbh->last_insert_id(...)
and currently caller needs to supply at least four undefs.

This change allows to call $dbh->last_insert_id() without any argument and
internally fill missing arguments with undefs. Therefore it does not change
API for drivers.


  Commit: c898cf9bfd8251813ce046d504d5451bdb5eb63f
      https://github.com/perl5-dbi/dbi/commit/c898cf9bfd8251813ce046d504d5451bdb5eb63f
  Author: Pali <pali@cpan.org>
  Date:   2018-04-27 (Fri, 27 Apr 2018)

  Changed paths:
    M DBI.pm
    M Driver.xst
    M dbd_xsh.h

  Log Message:
  -----------
  Introduce a new statement DBI method $sth->last_insert_id()

This method returns a value 'identifying' the row inserted by last
execution of the statement, if possible.

Similarly like $dbh->last_insert_id() but keep track of statement handle.

Some databases (like MariaDB) supports returning last insert id for
specified statement handle even different INSERT commands were executed.
This allows consistent last insert id implementations for these databases.

A fallback implementation just calls $dbh->last_insert_id().


  Commit: 80126d4638e77bcca85a5215cfed5c8793fa2de5
      https://github.com/perl5-dbi/dbi/commit/80126d4638e77bcca85a5215cfed5c8793fa2de5
  Author: Tim Bunce <Tim.Bunce@pobox.com>
  Date:   2018-05-16 (Wed, 16 May 2018)

  Changed paths:
    M DBI.pm
    M Driver.xst
    M dbd_xsh.h

  Log Message:
  -----------
  Merge pull request #64 from pali/last-insert-id

Add last_insert_id method on statement handles. Allow no arguments.


Compare: https://github.com/perl5-dbi/dbi/compare/448b99d08068...80126d4638e7
      **NOTE:** This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

----==_mimepart_5afc61a6c3c6d_14042af69b6b3c1477417--
0
Tim
5/16/2018 4:51:50 PM
perl.dbi.dev 1920 articles. 0 followers. Follow

0 Replies
50 Views

Similar Articles

[PageSpeed] 45

Reply: