Add default values for the parameters in the functions
This commit is contained in:
parent
bd8ec71855
commit
4bffdb5de1
@ -51,3 +51,10 @@
|
||||
params:
|
||||
- { name: ip_address, type: text}
|
||||
|
||||
- name: cdb_geocode_street_point
|
||||
return_type: Geometry
|
||||
params:
|
||||
- { name: searchtext, type: text}
|
||||
- { name: city, type: text, default: 'NULL'}
|
||||
- { name: state_province, type: text, default: 'NULL'}
|
||||
- { name: country, type: text, default: 'NULL'}
|
||||
|
@ -40,7 +40,14 @@ class SqlTemplateRenderer
|
||||
end
|
||||
|
||||
def params_with_type
|
||||
@function_signature['params'].map { |p| "#{p['name']} #{p['type']}"}.join(', ')
|
||||
parameters = @function_signature['params'].map do |p|
|
||||
if not p['default'].nil?
|
||||
"#{p['name']} #{p['type']} DEFAULT #{p['default']}"
|
||||
else
|
||||
"#{p['name']} #{p['type']}"
|
||||
end
|
||||
end
|
||||
return parameters.join(', ')
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user