pg-libphonenumber
pg-libphonenumber copied to clipboard
Is this still in alpha?
I notice there hasn't been development for a while, is this still in alpha?
Something like that. I'd consider it alpha- or pre-alpha quality at the moment. Most of my efforts stalled out after realizing that the space savings that this library could offer were relatively small compared to the risks involved with a native extension — especially memory safety issues and maintenance overhead. See #13 for reference.
Is it possible to implement the is valid? function, I would like to add a constraint for a text field and validate if it's e164 format.
From a technical standpoint, yes, it'd be possible. If that's the only function you need, though, and you're specifically interested in making sure a phone number matches the general E.164 format rather than trying to validate that it matches any given national number plan (which even libphonenumber doesn't do perfectly), you might consider just using a regular-expression check. Especially if you've got validation at the application layer — which is often a good idea even if only from a UX perspective — I suspect you'll find that the maintenance overhead of keeping a PostgreSQL native extension in your stack, making sure it continues to link against the version of libphonenumber in your OS's repositories, making sure that version doesn't have subtle differences in behavior from your application-layer and/or frontend validation, etc. ultimately doesn't make it a worthwhile trade-off to gain one library function at the database level.