You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have to use magic numbers like (1 << 16) when referencing Package flags. This is bad and inconvenient practice, so we should make constants available in SQL code somehow. There are 2 ways:
SQL functions like
CREATEFUNCTIONPackageFlag_VULNERABLE()
RETURNS int LANGUAGE sql IMMUTABLE PARALLEL SAFE AS'SELECT 1 << 16';
SELECT*FROM packages WHERE (flags & PackageFlag_VULNERABLE())::boolean;
Template values
SELECT*FROM packages WHERE (flags & {{ PackageFlag.VULNERABLE }} )::boolean;
The text was updated successfully, but these errors were encountered:
Currently we have to use magic numbers like
(1 << 16)
when referencing Package flags. This is bad and inconvenient practice, so we should make constants available in SQL code somehow. There are 2 ways:The text was updated successfully, but these errors were encountered: