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
File details
Details for the file is_valid_postgres_column_name-0.0.2.tar.gz
.
File metadata
- Download URL: is_valid_postgres_column_name-0.0.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8f9f39fccfc4248aa85163c51a660df5a8990097500f178429d871312b6491d6
|
|
MD5 |
cf92c31df4582903ec7733470ad04cb2
|
|
BLAKE2b-256 |
91c0df47cfdc709ca6dc667398b1f314f0b70c7ecc9710de4c9098a0129203b0
|
File details
Details for the file is_valid_postgres_column_name-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: is_valid_postgres_column_name-0.0.2-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
fb3d96606a54993b88a3c9ee67b48afb7cd85d4b9f7c99187ea0aa0caf288c21
|
|
MD5 |
378d33ad0e617179cc9b18c4eacc9f88
|
|
BLAKE2b-256 |
b7e615d35282a4401f8696168870d0c83468e18c20a8f669c2f2a26c5038d52a
|