We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code example:
$sqlt->add_procedure( name => 'order_total_suma', parameters => [ { argmode => 'in', name => '_deep', type => 'tstzrange', default => 1 }, ], ...
expected SQL:
CREATE FUNCTION "order_total_suma" (in _deep tstzrange default 1) ...
The text was updated successfully, but these errors were encountered:
--- 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 .= ')';
Sorry, something went wrong.
@rabbiveesh Hello. I saw recent updates. Is there a chance to apply this?
No branches or pull requests
code example:
expected SQL:
The text was updated successfully, but these errors were encountered: