WIP: SQL Column Parser
Library used to parse SQL CREATE TABLE statements into Python code used for code generation.
Intended usecase
Consider the following:
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE users (
identifier UUID DEFAULT uuid_generate_v4(),
email VARCHAR(256) UNIQUE NOT NULL,
name VARCHAR(256) NOT NULL,
is_admin BOOLEAN DEFAULT False,
password VARCHAR(512) NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (identifier)
);
CREATE INDEX users_email_idx ON users USING btree (email);
CREATE INDEX users_name_idx ON users USING btree (name);
The output would then be a list of columns of type:
@dataclasses.dataclass
class Table:
"""Table.
"""
columns: List[Column]
names: Names
class ColumnType(pydantic.BaseModel):
"""ColumnType.
"""
name: str
max_bytesize: Optional[pydantic.conint(ge=1)]
nullable: bool = True
default: Optional[str] = None
@dataclasses.dataclass
class Column:
"""Column.
"""
name: str
col_type: ColumnType
is_primary_key: bool
@dataclasses.dataclass
class Names():
"""Names.
"""
singular_name: str
plural_name: str
Metadata
Release files for sql-column-parser 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sql_column_parser-0.1.0.tar.gz | 6.7 kB | Without provenance | Details for sql_column_parser-0.1.0.tar.gz |
Release files / sql_column_parser-0.1.0.tar.gz
| Download URL | sql_column_parser-0.1.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66752eca473c6d3cf467368b0f6af49d3f6da387a4530be3fb978ca7a55f2714
|
|
BLAKE2b-256 checksum How to use checksums |
13a23bbc5d4fe4f21c2e2236947036054d4c8d2428c68dca4c5f3f27a921e82b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3
|
Security for sql-column-parser 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.