Sql Parser and Validator
Project description
sqlcarve
SQL Parser for Teachers
SQL Validation and execution
fichier.sql est le fichier à valider. ref_stmnt est la requête de référence pour la validation sémantique. referencefile.json est le modèle de commentaire pour la validation des commentaires.
Exemple de referencefile.json
{
"profcomments": {
"auteur": "",
"objectif": "",
"documentation": ""
},
"studentcomments": {
"author": "",
"cip": "",
"objectif": ""
}
}
Exemple d'utilisation
from src.sqlcarve.validator.validator import *
valid = Validator()
report = {}
with open("fichier.sql", "r") as f_content:
statement_list = Preprocessor.extract_stmnts(f_content)
for stmnt in statement_list:
report = valid.validate(statement=stmnt, ref_statement=ref_stmnt, ref_comments="referencefile.json", type="all")
print(report)
Résultat
{'commentaires': [], 'syntax': 'Validation syntaxique réussie', 'semantique': 'Validation sémantique réussie'}
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
Sqlcarve-0.4.21.tar.gz
(12.4 kB
view details)
Built Distribution
Sqlcarve-0.4.21-py3-none-any.whl
(16.6 kB
view details)
File details
Details for the file Sqlcarve-0.4.21.tar.gz
.
File metadata
- Download URL: Sqlcarve-0.4.21.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2321d629b9d6dc8d8c7b233064786995e171d1f23e2073b3ed355970dfa5e41 |
|
MD5 | 8aa1ed64b7f09af624c8f1c12904d99c |
|
BLAKE2b-256 | 64e4b151966f561bc1e46dec22739dbc4555fdf932b4c59f73d80ed42df08cc4 |
File details
Details for the file Sqlcarve-0.4.21-py3-none-any.whl
.
File metadata
- Download URL: Sqlcarve-0.4.21-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41f01fe962fe903f42303bcd7f1c9ab8eda7e28125cd4e072eee7709f8c92e40 |
|
MD5 | 12afeb1f1110a2f630579899354a1a4b |
|
BLAKE2b-256 | 06030b0a3f375aeecdf6c5443fbf24668a7d2f78e541fa0f41f34100e0675440 |