pg-libphonenumber icon indicating copy to clipboard operation
pg-libphonenumber copied to clipboard

Is this still in alpha?

Open ekiim opened this issue 2 years ago • 3 comments

I notice there hasn't been development for a while, is this still in alpha?

ekiim avatar Oct 31 '23 01:10 ekiim

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.

blm768 avatar Nov 01 '23 15:11 blm768

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.

ekiim avatar Nov 02 '23 06:11 ekiim

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.

blm768 avatar Nov 03 '23 06:11 blm768