Allows you to check if a given string can be PostgreSQL column name
Project description
I found it weird there's no simple way to check if a given string can be a PostgreSQL column name. Although, to my understanding, you can escape with quotation marks some names that are otherwise invalid, I don't think escaping such a thing is a good idea.
This validation is required if your column name can be dynamically generated.
How to use
>>> from is_valid_postgres_column_name import is_valid_postgres_column_name
>>> is_valid_postgres_column_name("column_A")
>>> True
>>> is_valid_postgres_column_name("1column_A")
>>> False
All PostgreSQL versions are supported. The only difference between versions, to my knowledge, are reserved keywords.
>>> is_valid_postgres_column_name("column_A", version=7.1)
>>> True
Installation
$ pip install -U is_valid_postgres_column_name
Requirements
Python 3.0+
Dependencies
None.
Contribution
Welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for is_valid_postgres_column_name-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | abcf9bc73feb587c602367b8b422207075421a3546744721b120c778dd8d099d |
|
MD5 | 1ea3b3d18fe1dc76ea24d2dcb6b0aab8 |
|
BLAKE2b-256 | 8044083c2d5776e7aa66843923d1d9c1afd352f0aa8e93a382689180dc260092 |
Close
Hashes for is_valid_postgres_column_name-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29de42f437299f312194d15134f464589571648e7f8713094c5e5757c2dbe0ec |
|
MD5 | 0469f9a3922d6a4c9bb478be1ca252d0 |
|
BLAKE2b-256 | 02f78e529b5fd0982c8b3090cbfb70f9bd70479095bbbfaa02dc43c4eda08997 |