t-sql 0.1.2__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- t_sql-1.0.1/.dockerignore +128 -0
- t_sql-1.0.1/.gitignore +177 -0
- t_sql-1.0.1/.idea/.gitignore +8 -0
- t_sql-1.0.1/.idea/inspectionProfiles/Project_Default.xml +24 -0
- t_sql-1.0.1/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- t_sql-1.0.1/.idea/misc.xml +11 -0
- t_sql-1.0.1/.idea/tsql.iml +10 -0
- t_sql-1.0.1/.idea/vcs.xml +6 -0
- t_sql-1.0.1/.idea/workspace.xml +92 -0
- t_sql-1.0.1/Dockerfile +8 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/PKG-INFO +27 -5
- t_sql-0.1.2/t_sql.egg-info/PKG-INFO → t_sql-1.0.1/README.md +24 -11
- t_sql-1.0.1/compose.yaml +14 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/pyproject.toml +12 -1
- t_sql-1.0.1/pytest.ini +2 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/tests/test_asyncpg_integration.py +2 -35
- t_sql-1.0.1/tests/test_escaped_binary_hex.py +146 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/tests/test_helper_functions.py +57 -5
- t_sql-1.0.1/tests/test_injection_edge_cases.py +161 -0
- t_sql-1.0.1/tests/test_injection_protection_validation.py +237 -0
- t_sql-1.0.1/tests/test_injections_for_escaped.py +157 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/tsql/__init__.py +31 -10
- {t_sql-0.1.2 → t_sql-1.0.1}/tsql/styles.py +4 -0
- t_sql-0.1.2/README.md +0 -151
- t_sql-0.1.2/setup.cfg +0 -4
- t_sql-0.1.2/t_sql.egg-info/SOURCES.txt +0 -15
- t_sql-0.1.2/t_sql.egg-info/dependency_links.txt +0 -1
- t_sql-0.1.2/t_sql.egg-info/top_level.txt +0 -1
- {t_sql-0.1.2 → t_sql-1.0.1}/LICENSE +0 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/tests/test_different_object_types.py +0 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/tests/test_escaped.py +0 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/tests/test_styles.py +0 -0
- {t_sql-0.1.2 → t_sql-1.0.1}/tests/test_tsql.py +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
.git
|
|
2
|
+
.venv
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
# C extensions
|
|
10
|
+
*.so
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
.Python
|
|
14
|
+
build/
|
|
15
|
+
develop-eggs/
|
|
16
|
+
dist/
|
|
17
|
+
downloads/
|
|
18
|
+
eggs/
|
|
19
|
+
.eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
wheels/
|
|
26
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
cover/
|
|
56
|
+
|
|
57
|
+
# Translations
|
|
58
|
+
*.mo
|
|
59
|
+
*.pot
|
|
60
|
+
|
|
61
|
+
# Django stuff:
|
|
62
|
+
*.log
|
|
63
|
+
local_settings.py
|
|
64
|
+
db.sqlite3
|
|
65
|
+
db.sqlite3-journal
|
|
66
|
+
|
|
67
|
+
# Flask stuff:
|
|
68
|
+
instance/
|
|
69
|
+
.webassets-cache
|
|
70
|
+
|
|
71
|
+
# Scrapy stuff:
|
|
72
|
+
.scrapy
|
|
73
|
+
|
|
74
|
+
# Sphinx documentation
|
|
75
|
+
docs/_build/
|
|
76
|
+
|
|
77
|
+
# PyBuilder
|
|
78
|
+
.pybuilder/
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
90
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
91
|
+
# .python-version
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
# Environments
|
|
95
|
+
.env
|
|
96
|
+
.venv
|
|
97
|
+
env/
|
|
98
|
+
venv/
|
|
99
|
+
ENV/
|
|
100
|
+
env.bak/
|
|
101
|
+
venv.bak/
|
|
102
|
+
|
|
103
|
+
# mypy
|
|
104
|
+
.mypy_cache/
|
|
105
|
+
.dmypy.json
|
|
106
|
+
dmypy.json
|
|
107
|
+
|
|
108
|
+
# Pyre type checker
|
|
109
|
+
.pyre/
|
|
110
|
+
|
|
111
|
+
# pytype static type analyzer
|
|
112
|
+
.pytype/
|
|
113
|
+
|
|
114
|
+
# Cython debug symbols
|
|
115
|
+
cython_debug/
|
|
116
|
+
|
|
117
|
+
# PyCharm
|
|
118
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
119
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
120
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
121
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
122
|
+
#.idea/
|
|
123
|
+
|
|
124
|
+
# Ruff stuff:
|
|
125
|
+
.ruff_cache/
|
|
126
|
+
|
|
127
|
+
# PyPI configuration file
|
|
128
|
+
.pypirc
|
t_sql-1.0.1/.gitignore
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# ai
|
|
2
|
+
.claude/
|
|
3
|
+
|
|
4
|
+
# Byte-compiled / optimized / DLL files
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*$py.class
|
|
8
|
+
|
|
9
|
+
# C extensions
|
|
10
|
+
*.so
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
.Python
|
|
14
|
+
build/
|
|
15
|
+
develop-eggs/
|
|
16
|
+
dist/
|
|
17
|
+
downloads/
|
|
18
|
+
eggs/
|
|
19
|
+
.eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
wheels/
|
|
26
|
+
share/python-wheels/
|
|
27
|
+
*.egg-info/
|
|
28
|
+
.installed.cfg
|
|
29
|
+
*.egg
|
|
30
|
+
MANIFEST
|
|
31
|
+
|
|
32
|
+
# PyInstaller
|
|
33
|
+
# Usually these files are written by a python script from a template
|
|
34
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
35
|
+
*.manifest
|
|
36
|
+
*.spec
|
|
37
|
+
|
|
38
|
+
# Installer logs
|
|
39
|
+
pip-log.txt
|
|
40
|
+
pip-delete-this-directory.txt
|
|
41
|
+
|
|
42
|
+
# Unit test / coverage reports
|
|
43
|
+
htmlcov/
|
|
44
|
+
.tox/
|
|
45
|
+
.nox/
|
|
46
|
+
.coverage
|
|
47
|
+
.coverage.*
|
|
48
|
+
.cache
|
|
49
|
+
nosetests.xml
|
|
50
|
+
coverage.xml
|
|
51
|
+
*.cover
|
|
52
|
+
*.py,cover
|
|
53
|
+
.hypothesis/
|
|
54
|
+
.pytest_cache/
|
|
55
|
+
cover/
|
|
56
|
+
|
|
57
|
+
# Translations
|
|
58
|
+
*.mo
|
|
59
|
+
*.pot
|
|
60
|
+
|
|
61
|
+
# Django stuff:
|
|
62
|
+
*.log
|
|
63
|
+
local_settings.py
|
|
64
|
+
db.sqlite3
|
|
65
|
+
db.sqlite3-journal
|
|
66
|
+
|
|
67
|
+
# Flask stuff:
|
|
68
|
+
instance/
|
|
69
|
+
.webassets-cache
|
|
70
|
+
|
|
71
|
+
# Scrapy stuff:
|
|
72
|
+
.scrapy
|
|
73
|
+
|
|
74
|
+
# Sphinx documentation
|
|
75
|
+
docs/_build/
|
|
76
|
+
|
|
77
|
+
# PyBuilder
|
|
78
|
+
.pybuilder/
|
|
79
|
+
target/
|
|
80
|
+
|
|
81
|
+
# Jupyter Notebook
|
|
82
|
+
.ipynb_checkpoints
|
|
83
|
+
|
|
84
|
+
# IPython
|
|
85
|
+
profile_default/
|
|
86
|
+
ipython_config.py
|
|
87
|
+
|
|
88
|
+
# pyenv
|
|
89
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
90
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
91
|
+
.python-version
|
|
92
|
+
|
|
93
|
+
# pipenv
|
|
94
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
95
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
96
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
97
|
+
# install all needed dependencies.
|
|
98
|
+
#Pipfile.lock
|
|
99
|
+
|
|
100
|
+
# UV
|
|
101
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
102
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
103
|
+
# commonly ignored for libraries.
|
|
104
|
+
uv.lock
|
|
105
|
+
|
|
106
|
+
# poetry
|
|
107
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
108
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
109
|
+
# commonly ignored for libraries.
|
|
110
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
111
|
+
#poetry.lock
|
|
112
|
+
|
|
113
|
+
# pdm
|
|
114
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
115
|
+
#pdm.lock
|
|
116
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
117
|
+
# in version control.
|
|
118
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
119
|
+
.pdm.toml
|
|
120
|
+
.pdm-python
|
|
121
|
+
.pdm-build/
|
|
122
|
+
|
|
123
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
124
|
+
__pypackages__/
|
|
125
|
+
|
|
126
|
+
# Celery stuff
|
|
127
|
+
celerybeat-schedule
|
|
128
|
+
celerybeat.pid
|
|
129
|
+
|
|
130
|
+
# SageMath parsed files
|
|
131
|
+
*.sage.py
|
|
132
|
+
|
|
133
|
+
# Environments
|
|
134
|
+
.env
|
|
135
|
+
.venv
|
|
136
|
+
env/
|
|
137
|
+
venv/
|
|
138
|
+
ENV/
|
|
139
|
+
env.bak/
|
|
140
|
+
venv.bak/
|
|
141
|
+
|
|
142
|
+
# Spyder project settings
|
|
143
|
+
.spyderproject
|
|
144
|
+
.spyproject
|
|
145
|
+
|
|
146
|
+
# Rope project settings
|
|
147
|
+
.ropeproject
|
|
148
|
+
|
|
149
|
+
# mkdocs documentation
|
|
150
|
+
/site
|
|
151
|
+
|
|
152
|
+
# mypy
|
|
153
|
+
.mypy_cache/
|
|
154
|
+
.dmypy.json
|
|
155
|
+
dmypy.json
|
|
156
|
+
|
|
157
|
+
# Pyre type checker
|
|
158
|
+
.pyre/
|
|
159
|
+
|
|
160
|
+
# pytype static type analyzer
|
|
161
|
+
.pytype/
|
|
162
|
+
|
|
163
|
+
# Cython debug symbols
|
|
164
|
+
cython_debug/
|
|
165
|
+
|
|
166
|
+
# PyCharm
|
|
167
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
168
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
169
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
170
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
171
|
+
#.idea/
|
|
172
|
+
|
|
173
|
+
# Ruff stuff:
|
|
174
|
+
.ruff_cache/
|
|
175
|
+
|
|
176
|
+
# PyPI configuration file
|
|
177
|
+
.pypirc
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
5
|
+
<inspection_tool class="PyCompatibilityInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
6
|
+
<option name="ourVersions">
|
|
7
|
+
<value>
|
|
8
|
+
<list size="3">
|
|
9
|
+
<item index="0" class="java.lang.String" itemvalue="3.11" />
|
|
10
|
+
<item index="1" class="java.lang.String" itemvalue="3.12" />
|
|
11
|
+
<item index="2" class="java.lang.String" itemvalue="3.13" />
|
|
12
|
+
</list>
|
|
13
|
+
</value>
|
|
14
|
+
</option>
|
|
15
|
+
</inspection_tool>
|
|
16
|
+
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
|
17
|
+
<option name="ignoredIdentifiers">
|
|
18
|
+
<list>
|
|
19
|
+
<option value="base64.binascii" />
|
|
20
|
+
</list>
|
|
21
|
+
</option>
|
|
22
|
+
</inspection_tool>
|
|
23
|
+
</profile>
|
|
24
|
+
</component>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="Black">
|
|
4
|
+
<option name="sdkName" value="uv (tsql)" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="KubernetesApiPersistence">{}</component>
|
|
7
|
+
<component name="KubernetesApiProvider"><![CDATA[{
|
|
8
|
+
"isMigrated": true
|
|
9
|
+
}]]></component>
|
|
10
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="uv (tsql)" project-jdk-type="Python SDK" />
|
|
11
|
+
</project>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module version="4">
|
|
3
|
+
<component name="PyDocumentationSettings">
|
|
4
|
+
<option name="format" value="PLAIN" />
|
|
5
|
+
<option name="myDocStringFormat" value="Plain" />
|
|
6
|
+
</component>
|
|
7
|
+
<component name="TestRunnerService">
|
|
8
|
+
<option name="PROJECT_TEST_RUNNER" value="py.test" />
|
|
9
|
+
</component>
|
|
10
|
+
</module>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="AutoImportSettings">
|
|
4
|
+
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ChangeListManager">
|
|
7
|
+
<list default="true" id="059146b3-62bd-4ad4-890d-4356cf237b89" name="Changes" comment="">
|
|
8
|
+
<change beforePath="$PROJECT_DIR$/pyproject.toml" beforeDir="false" afterPath="$PROJECT_DIR$/pyproject.toml" afterDir="false" />
|
|
9
|
+
<change beforePath="$PROJECT_DIR$/tests/test_helper_functions.py" beforeDir="false" afterPath="$PROJECT_DIR$/tests/test_helper_functions.py" afterDir="false" />
|
|
10
|
+
<change beforePath="$PROJECT_DIR$/tests/test_injections_for_escaped.py" beforeDir="false" afterPath="$PROJECT_DIR$/tests/test_injections_for_escaped.py" afterDir="false" />
|
|
11
|
+
<change beforePath="$PROJECT_DIR$/tsql/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/tsql/__init__.py" afterDir="false" />
|
|
12
|
+
</list>
|
|
13
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
14
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
15
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
16
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
17
|
+
</component>
|
|
18
|
+
<component name="Git.Settings">
|
|
19
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
20
|
+
</component>
|
|
21
|
+
<component name="GitHubPullRequestSearchHistory">{
|
|
22
|
+
"lastFilter": {
|
|
23
|
+
"state": "OPEN",
|
|
24
|
+
"assignee": "nhumrich"
|
|
25
|
+
}
|
|
26
|
+
}</component>
|
|
27
|
+
<component name="GithubPullRequestsUISettings">{
|
|
28
|
+
"selectedUrlAndAccountId": {
|
|
29
|
+
"url": "git@github.com:nhumrich/tsql.git",
|
|
30
|
+
"accountId": "f308fc0d-c429-47fb-8e52-74bdc95408d8"
|
|
31
|
+
}
|
|
32
|
+
}</component>
|
|
33
|
+
<component name="ProjectColorInfo">{
|
|
34
|
+
"associatedIndex": 2
|
|
35
|
+
}</component>
|
|
36
|
+
<component name="ProjectId" id="33DagtaPqCq8RWQhigWGQcgOtLh" />
|
|
37
|
+
<component name="ProjectViewState">
|
|
38
|
+
<option name="compactDirectories" value="true" />
|
|
39
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
|
40
|
+
<option name="showLibraryContents" value="true" />
|
|
41
|
+
</component>
|
|
42
|
+
<component name="PropertiesComponent"><![CDATA[{
|
|
43
|
+
"keyToString": {
|
|
44
|
+
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
|
45
|
+
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
46
|
+
"RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
|
|
47
|
+
"RunOnceActivity.git.unshallow": "true",
|
|
48
|
+
"git-widget-placeholder": "main",
|
|
49
|
+
"junie.onboarding.icon.badge.shown": "true",
|
|
50
|
+
"last_opened_file_path": "/home/nhumrich/personal/tsql",
|
|
51
|
+
"node.js.detected.package.eslint": "true",
|
|
52
|
+
"node.js.detected.package.tslint": "true",
|
|
53
|
+
"node.js.selected.package.eslint": "(autodetect)",
|
|
54
|
+
"node.js.selected.package.tslint": "(autodetect)",
|
|
55
|
+
"nodejs_package_manager_path": "npm",
|
|
56
|
+
"to.speed.mode.migration.done": "true",
|
|
57
|
+
"vue.rearranger.settings.migration": "true"
|
|
58
|
+
}
|
|
59
|
+
}]]></component>
|
|
60
|
+
<component name="SharedIndexes">
|
|
61
|
+
<attachedChunks>
|
|
62
|
+
<set>
|
|
63
|
+
<option value="bundled-js-predefined-d6986cc7102b-3aa1da707db6-JavaScript-PY-252.26830.99" />
|
|
64
|
+
<option value="bundled-python-sdk-164cda30dcd9-0af03a5fa574-com.jetbrains.pycharm.pro.sharedIndexes.bundled-PY-252.26830.99" />
|
|
65
|
+
</set>
|
|
66
|
+
</attachedChunks>
|
|
67
|
+
</component>
|
|
68
|
+
<component name="TaskManager">
|
|
69
|
+
<task active="true" id="Default" summary="Default task">
|
|
70
|
+
<changelist id="059146b3-62bd-4ad4-890d-4356cf237b89" name="Changes" comment="" />
|
|
71
|
+
<created>1758854212149</created>
|
|
72
|
+
<option name="number" value="Default" />
|
|
73
|
+
<option name="presentableId" value="Default" />
|
|
74
|
+
<updated>1758854212149</updated>
|
|
75
|
+
</task>
|
|
76
|
+
<servers />
|
|
77
|
+
</component>
|
|
78
|
+
<component name="TypeScriptGeneratedFilesManager">
|
|
79
|
+
<option name="version" value="3" />
|
|
80
|
+
</component>
|
|
81
|
+
<component name="Vcs.Log.Tabs.Properties">
|
|
82
|
+
<option name="TAB_STATES">
|
|
83
|
+
<map>
|
|
84
|
+
<entry key="MAIN">
|
|
85
|
+
<value>
|
|
86
|
+
<State />
|
|
87
|
+
</value>
|
|
88
|
+
</entry>
|
|
89
|
+
</map>
|
|
90
|
+
</option>
|
|
91
|
+
</component>
|
|
92
|
+
</project>
|
t_sql-1.0.1/Dockerfile
ADDED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: t-sql
|
|
3
|
-
Version: 0.1
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: Safe SQL. SQL queries for python t-strings (PEP 750)
|
|
5
|
+
Project-URL: Homepage, https://github.com/nhumrich/tsql
|
|
6
|
+
License-File: LICENSE
|
|
5
7
|
Requires-Python: >=3.14
|
|
6
8
|
Description-Content-Type: text/markdown
|
|
7
|
-
License-File: LICENSE
|
|
8
|
-
Dynamic: license-file
|
|
9
9
|
|
|
10
10
|
# tsql
|
|
11
11
|
|
|
@@ -14,10 +14,27 @@ A lightweight SQL templating library that leverages Python 3.14's t-strings (PEP
|
|
|
14
14
|
TSQL provides a safe way to write SQL queries using Python's template strings (t-strings) while preventing SQL injection attacks through multiple parameter styling options.
|
|
15
15
|
|
|
16
16
|
## ⚠️ Python Version Requirement
|
|
17
|
-
This library requires Python 3.
|
|
17
|
+
This library requires Python 3.14+
|
|
18
18
|
|
|
19
19
|
TSQL is built specifically to take advantage of the new t-string feature introduced in PEP 750, which is only available in Python 3.14+.
|
|
20
20
|
|
|
21
|
+
## Installing
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
# with pip
|
|
25
|
+
pip install t-sql
|
|
26
|
+
|
|
27
|
+
# with uv
|
|
28
|
+
uv add t-sql
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## using
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
import tsql
|
|
35
|
+
|
|
36
|
+
tsql.render(t"select * from users where name={name)")
|
|
37
|
+
```
|
|
21
38
|
|
|
22
39
|
## Parameter Styles
|
|
23
40
|
|
|
@@ -95,7 +112,7 @@ You can use the "unsafe" format spec for these
|
|
|
95
112
|
cases:
|
|
96
113
|
```python
|
|
97
114
|
dynamic_where = input('type where clause')
|
|
98
|
-
tsql.render(
|
|
115
|
+
tsql.render(t"SELECT * FROM users WHERE {dynamic_where:unsafe}")
|
|
99
116
|
```
|
|
100
117
|
|
|
101
118
|
### as_values
|
|
@@ -103,6 +120,11 @@ tsql.render(f"SELECT * FROM users WHERE {dynamic_where:unsafe}")
|
|
|
103
120
|
The spec `:as_values` formats a dictionary into the format:
|
|
104
121
|
`(key1, key2, ...) VALUES (value1, value2, ...)` for uses in insert statements.
|
|
105
122
|
|
|
123
|
+
### as_set
|
|
124
|
+
|
|
125
|
+
The spec `:as_set` formats a dictionary into the format:
|
|
126
|
+
`key1='?', key2='?'` for uses in update statements.
|
|
127
|
+
|
|
106
128
|
### traditional format_spec
|
|
107
129
|
|
|
108
130
|
All other format specs should be handled as they would in a normal f-string.
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: t-sql
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: Safe SQL. SQL queries for python t-strings (PEP 750)
|
|
5
|
-
Requires-Python: >=3.14
|
|
6
|
-
Description-Content-Type: text/markdown
|
|
7
|
-
License-File: LICENSE
|
|
8
|
-
Dynamic: license-file
|
|
9
|
-
|
|
10
1
|
# tsql
|
|
11
2
|
|
|
12
3
|
A lightweight SQL templating library that leverages Python 3.14's t-strings (PEP 750).
|
|
@@ -14,10 +5,27 @@ A lightweight SQL templating library that leverages Python 3.14's t-strings (PEP
|
|
|
14
5
|
TSQL provides a safe way to write SQL queries using Python's template strings (t-strings) while preventing SQL injection attacks through multiple parameter styling options.
|
|
15
6
|
|
|
16
7
|
## ⚠️ Python Version Requirement
|
|
17
|
-
This library requires Python 3.
|
|
8
|
+
This library requires Python 3.14+
|
|
18
9
|
|
|
19
10
|
TSQL is built specifically to take advantage of the new t-string feature introduced in PEP 750, which is only available in Python 3.14+.
|
|
20
11
|
|
|
12
|
+
## Installing
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
# with pip
|
|
16
|
+
pip install t-sql
|
|
17
|
+
|
|
18
|
+
# with uv
|
|
19
|
+
uv add t-sql
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## using
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
import tsql
|
|
26
|
+
|
|
27
|
+
tsql.render(t"select * from users where name={name)")
|
|
28
|
+
```
|
|
21
29
|
|
|
22
30
|
## Parameter Styles
|
|
23
31
|
|
|
@@ -95,7 +103,7 @@ You can use the "unsafe" format spec for these
|
|
|
95
103
|
cases:
|
|
96
104
|
```python
|
|
97
105
|
dynamic_where = input('type where clause')
|
|
98
|
-
tsql.render(
|
|
106
|
+
tsql.render(t"SELECT * FROM users WHERE {dynamic_where:unsafe}")
|
|
99
107
|
```
|
|
100
108
|
|
|
101
109
|
### as_values
|
|
@@ -103,6 +111,11 @@ tsql.render(f"SELECT * FROM users WHERE {dynamic_where:unsafe}")
|
|
|
103
111
|
The spec `:as_values` formats a dictionary into the format:
|
|
104
112
|
`(key1, key2, ...) VALUES (value1, value2, ...)` for uses in insert statements.
|
|
105
113
|
|
|
114
|
+
### as_set
|
|
115
|
+
|
|
116
|
+
The spec `:as_set` formats a dictionary into the format:
|
|
117
|
+
`key1='?', key2='?'` for uses in update statements.
|
|
118
|
+
|
|
106
119
|
### traditional format_spec
|
|
107
120
|
|
|
108
121
|
All other format specs should be handled as they would in a normal f-string.
|
t_sql-1.0.1/compose.yaml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
services:
|
|
2
|
+
postgres:
|
|
3
|
+
image: postgres:16
|
|
4
|
+
ports:
|
|
5
|
+
- "5454:5432"
|
|
6
|
+
environment:
|
|
7
|
+
POSTGRES_PASSWORD: password
|
|
8
|
+
POSTGRES_USER: postgres
|
|
9
|
+
POSTGRES_DB: postgres
|
|
10
|
+
healthcheck:
|
|
11
|
+
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
12
|
+
interval: 5s
|
|
13
|
+
timeout: 5s
|
|
14
|
+
retries: 5
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
1
5
|
[project]
|
|
2
6
|
name = "t-sql"
|
|
3
|
-
version = "0.1
|
|
7
|
+
version = "1.0.1"
|
|
4
8
|
description = "Safe SQL. SQL queries for python t-strings (PEP 750)"
|
|
5
9
|
readme = "README.md"
|
|
6
10
|
requires-python = ">=3.14"
|
|
7
11
|
dependencies = []
|
|
8
12
|
|
|
13
|
+
[project.urls]
|
|
14
|
+
Homepage = "https://github.com/nhumrich/tsql"
|
|
15
|
+
|
|
16
|
+
|
|
9
17
|
[dependency-groups]
|
|
10
18
|
dev = [
|
|
11
19
|
"anyio>=4.9.0",
|
|
@@ -13,3 +21,6 @@ dev = [
|
|
|
13
21
|
"pytest>=8.3.5",
|
|
14
22
|
"pytest-asyncio>=0.24.0",
|
|
15
23
|
]
|
|
24
|
+
|
|
25
|
+
[tool.hatch.build.targets.wheel]
|
|
26
|
+
packages = ["tsql"]
|
t_sql-1.0.1/pytest.ini
ADDED