This is an archival post from my newsletter. Join the newsletter to get in the loop.

Joseph Scott’s Blog » The Metadata Problem With Databases

Joseph Scott’s Blog » The Metadata Problem With Databases:

"CREATE FUNCTION metadata_regex(varchar)
RETURNS varchar AS '
  SELECT regex
  FROM metadata
  WHERE column_name = $1;
' LANGUAGE SQL;
ALTER TABLE users ADD CONSTRAINT
username_ck CHECK (
  username ~ metadata_regex('username')
);
"

                    <p>
                      (Via <a href="http://joseph.randomnetworks.com/">Joseph Scott's Blog</a>.)
                    </p> - Intersting DB field metadata post

Join my mailing list

Join my mailing list and get a copy of my ebook, Securing the Five Figure Sale, for free. Instantly.