X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDB%2FResultSet%2FMessage.pm;fp=Debbugs%2FDB%2FResultSet%2FMessage.pm;h=0000000000000000000000000000000000000000;hb=1e6633a3780f4fd53fc4303852e84d13cdad2dc6;hp=08509ce701212ad03ac37a146c59aaed5c6ff2af;hpb=466f7faff129a5699c7674f59900a92aa256175d;p=debbugs.git diff --git a/Debbugs/DB/ResultSet/Message.pm b/Debbugs/DB/ResultSet/Message.pm deleted file mode 100644 index 08509ce..0000000 --- a/Debbugs/DB/ResultSet/Message.pm +++ /dev/null @@ -1,56 +0,0 @@ -# This module is part of debbugs, and is released -# under the terms of the GPL version 2, or any later version. See the -# file README and COPYING for more information. -# Copyright 2017 by Don Armstrong . -use utf8; -package Debbugs::DB::ResultSet::Message; - -=head1 NAME - -Debbugs::DB::ResultSet::Message - Message table actions - -=head1 SYNOPSIS - - - -=head1 DESCRIPTION - - - -=cut - -use strict; -use warnings; - -use base 'DBIx::Class::ResultSet'; - -use Debbugs::DB::Util qw(select_one); - -sub get_message_id { - my ($self,$msg_id,$from,$to,$subject) = @_; - return $self->result_source->schema->storage-> - dbh_do(sub { - my ($dbh,$msg_id,$from,$to,$subject) = @_; - my $mi = select_one($dbh,<<'SQL',@_[1..$#_],@_[1..$#_]); -WITH ins AS ( -INSERT INTO message (msgid,from_complete,to_complete,subject) VALUES (?,?,?,?) - ON CONFLICT (msgid,from_complete,to_complete,subject) DO NOTHING RETURNING id -) -SELECT id FROM ins -UNION ALL -SELECT id FROM correspondent WHERE msgid=? AND from_complete = ? -AND to_complete = ? AND subject = ? -LIMIT 1; -SQL - return $mi; -}, - @_[1..$#_] - ); - -} - - - -1; - -__END__