@hot-updater/postgres 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/sql/semver_satisfies.sql +29 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/postgres",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.4",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"package.json"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@hot-updater/core": "0.5.
|
|
33
|
-
"@hot-updater/plugin-core": "0.5.
|
|
32
|
+
"@hot-updater/core": "0.5.4",
|
|
33
|
+
"@hot-updater/plugin-core": "0.5.4",
|
|
34
34
|
"kysely": "^0.27.5",
|
|
35
35
|
"pg": "^8.13.1"
|
|
36
36
|
},
|
package/sql/semver_satisfies.sql
CHANGED
|
@@ -89,11 +89,38 @@ BEGIN
|
|
|
89
89
|
satisfies := (version >= lower_bound AND version < upper_bound);
|
|
90
90
|
END;
|
|
91
91
|
|
|
92
|
+
-- [Added] 1) Single major version pattern '^(\d+)$'
|
|
93
|
+
ELSIF range_expression ~ '^\d+$' THEN
|
|
94
|
+
/*
|
|
95
|
+
e.g.) "1" is interpreted as (>=1.0.0 <2.0.0) in semver range
|
|
96
|
+
"2" would be interpreted as (>=2.0.0 <3.0.0)
|
|
97
|
+
*/
|
|
98
|
+
DECLARE
|
|
99
|
+
major_range INT := range_expression::INT;
|
|
100
|
+
lower_bound TEXT := major_range || '.0.0';
|
|
101
|
+
upper_bound TEXT := (major_range + 1) || '.0.0';
|
|
102
|
+
BEGIN
|
|
103
|
+
satisfies := (version >= lower_bound AND version < upper_bound);
|
|
104
|
+
END;
|
|
105
|
+
|
|
106
|
+
-- [Added] 2) major.x pattern '^(\d+)\.x$'
|
|
107
|
+
ELSIF range_expression ~ '^\d+\.x$' THEN
|
|
108
|
+
/*
|
|
109
|
+
e.g.) "2.x" => as long as major=2 matches, any minor and patch is OK
|
|
110
|
+
effectively works like (>=2.0.0 <3.0.0)
|
|
111
|
+
*/
|
|
112
|
+
DECLARE
|
|
113
|
+
major_range INT := split_part(range_expression, '.', 1)::INT;
|
|
114
|
+
lower_bound TEXT := major_range || '.0.0';
|
|
115
|
+
upper_bound TEXT := (major_range + 1) || '.0.0';
|
|
116
|
+
BEGIN
|
|
117
|
+
satisfies := (version >= lower_bound AND version < upper_bound);
|
|
118
|
+
END;
|
|
119
|
+
|
|
92
120
|
ELSE
|
|
93
121
|
RAISE EXCEPTION 'Unsupported range expression: %', range_expression;
|
|
94
122
|
END IF;
|
|
95
123
|
|
|
96
124
|
RETURN satisfies;
|
|
97
125
|
END;
|
|
98
|
-
$$ LANGUAGE plpgsql;
|
|
99
|
-
|
|
126
|
+
$$ LANGUAGE plpgsql;
|