forked from volkanunsal/postgres-rrule
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
662593d
commit 2017a66
Showing
5 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
CREATE OR REPLACE FUNCTION _rrule.rrule_to_jsonb("input" _rrule.RRULE) | ||
RETURNS jsonb AS $$ | ||
BEGIN | ||
RETURN jsonb_build_object( | ||
'freq', "input"."freq", | ||
'interval', "input"."interval", | ||
'count', "input"."count", | ||
'until', "input"."until", | ||
'bysecond', "input"."bysecond", | ||
'byminute', "input"."byminute", | ||
'byhour', "input"."byhour", | ||
'byday', "input"."byday", | ||
'bymonthday', "input"."bymonthday", | ||
'byyearday', "input"."byyearday", | ||
'byweekno', "input"."byweekno", | ||
'bymonth', "input"."bymonth", | ||
'bysetpos', "input"."bysetpos", | ||
'wkst', "input"."wkst" | ||
); | ||
END; | ||
$$ LANGUAGE plpgsql IMMUTABLE STRICT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
CREATE OR REPLACE FUNCTION _rrule.rruleset_to_jsonb("input" _rrule.RRULESET) | ||
RETURNS jsonb AS $$ | ||
DECLARE | ||
rrule jsonb; | ||
exrule jsonb; | ||
BEGIN | ||
SELECT _rrule.rrule_to_jsonb("input"."rrule") | ||
INTO rrule; | ||
|
||
SELECT _rrule.rrule_to_jsonb("input"."exrule") | ||
INTO exrule; | ||
|
||
RETURN jsonb_build_object( | ||
'dtstart', "input"."dtstart", | ||
'dtend', "input"."dtend", | ||
'rrule', rrule, | ||
'exrule', exrule, | ||
'rdate', "input"."rdate", | ||
'exdate', "input"."exdate" | ||
); | ||
END; | ||
$$ LANGUAGE plpgsql IMMUTABLE STRICT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters