Do not enforce types for params #302
As types are tied to a schema, they don't get along very well with pl/proxy. Do not use them for the service_type.
This commit is contained in:
parent
0d92eb4ba8
commit
9c6eabc59e
@ -378,7 +378,7 @@
|
||||
- { name: aggregate_type, type: text, default: 'NULL' }
|
||||
|
||||
- name: cdb_service_quota_info
|
||||
return_type: SETOF cdb_dataservices_client.service_quota_info
|
||||
return_type: SETOF service_quota_info
|
||||
multi_row: true
|
||||
multi_field: true
|
||||
params:
|
||||
@ -387,5 +387,5 @@
|
||||
- name: cdb_enough_quota
|
||||
return_type: BOOLEAN
|
||||
params:
|
||||
- { name: service, type: cdb_dataservices_client.service_type }
|
||||
- { name: service, type: TEXT }
|
||||
- { name: input_size, type: NUMERIC }
|
@ -91,7 +91,7 @@ $$ LANGUAGE plpythonu;
|
||||
CREATE OR REPLACE FUNCTION cdb_dataservices_server.cdb_enough_quota(
|
||||
username TEXT,
|
||||
orgname TEXT,
|
||||
service_ cdb_dataservices_server.service_type,
|
||||
service_ TEXT,
|
||||
input_size NUMERIC)
|
||||
returns BOOLEAN AS $$
|
||||
DECLARE
|
||||
@ -99,7 +99,7 @@ returns BOOLEAN AS $$
|
||||
BEGIN
|
||||
SELECT * INTO params
|
||||
FROM cdb_dataservices_server.cdb_service_quota_info(username, orgname) AS p
|
||||
WHERE p.service = service_;
|
||||
WHERE p.service = service_::cdb_dataservices_server.service_type;
|
||||
RETURN params.soft_limit OR ((params.used_quota + input_size) <= params.monthly_quota);
|
||||
END
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
Loading…
Reference in New Issue
Block a user