-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
27 lines (27 loc) · 1022 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
deploy:
vsql -U dbadmin -X -f fmt.sql
@echo " \
GRANT EXECUTE ON FUNCTION FMT(n NUMERIC) TO PUBLIC ; \
GRANT EXECUTE ON FUNCTION FMT(n NUMERIC, d INTEGER) TO PUBLIC ; \
GRANT EXECUTE ON FUNCTION FMT(n NUMERIC, d INTEGER, f VARCHAR ) TO PUBLIC ; \
" | vsql -U dbadmin -AXntqe -f -
test:
@echo " \
SELECT FMT(-1234); \
SELECT FMT(-1234567890); \
SELECT FMT(1234567890.98765); \
SELECT FMT(1234567890.98765, 3); \
SELECT FMT(1234567890.98765, 3, 'N'); \
SELECT FMT(-1234566666666666677777777777777778888888888888889999999999999999.7896543); \
SELECT FMT(-1234566666666666677777777777777778888888888888889999999999999999.7896543, 4, 'N'); \
SELECT FMT(0.1234, 0, 'P'); \
SELECT FMT(0.1234621, 2, 'P'); \
SELECT FMT(0.00345432, 3, 'T'); \
SELECT FMT(126.987654, 3, 'P'); \
" | vsql -U dbadmin -X -f - -e
clean:
@echo " \
DROP FUNCTION FMT(n NUMERIC) ; \
DROP FUNCTION FMT(n NUMERIC, d INTEGER) ; \
DROP FUNCTION FMT(n NUMERIC, d INTEGER, f VARCHAR) ; \
" | vsql -U dbadmin -X -f - -e