[DBIx-Class-Devel] [dbsrgits/sql-translator] Add support for 'default' parameter (#119)
Eugen Konkov
notifications at github.com
Mon Jun 24 19:22:40 GMT 2019
```diff
--- a/lib/SQL/Translator/Producer/PostgreSQL.pm
+++ b/lib/SQL/Translator/Producer/PostgreSQL.pm
@@ -756,9 +756,13 @@ sub create_procedure {
my @args = ();
foreach my $arg (@{$procedure->parameters}) {
$arg = {name => $arg} if ref($arg) ne 'HASH';
- push @args, join(' ', map $arg->{$_},
+ my $param = join(' ', map $arg->{$_},
grep defined($arg->{$_}),
qw/argmode name type/);
+ if( defined $arg->{ default } ) {
+ $param .= ' default ' .$arg->{ default };
+ }
+ push @args, $param;
}
$sql .= join(', ', @args);
$sql .= ')';
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/issues/119#issuecomment-505145040
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20190624/44b5b167/attachment.htm>
More information about the DBIx-Class-Devel
mailing list