fastmysql
介绍
简单快速的使用mysql
软件架构
软件架构说明
安装教程
- pip安装
pip3 install fastmysql
- pip安装(使用淘宝镜像加速)
pip3 install fastmysql -i https://mirrors.aliyun.com/pypi/simple
使用说明
- demo
import fastmysql
query_res = fastmysql.query_table_all_data(
db_name='test',
tb_name='test'
)
# 获取建表语句
res = fastmysql.show_create_table(
db_name='test',
tb_name='test'
)
- 防止sql注入: 写法
cursor.execute('insert into user (name,password) value (?,?)',(name,password)) 或者
cursor.execute('insert into user (name,password) value (%s,%s)',(name,password)) %s与?都可以作为sql语句的占位符,它们作为占位符的功能是没有区别的,mysql.connector用 %s 作为占位符;pymysql用 ? 作为占位符。但是注意不要写成
cursor.execute('insert into user (name,password) value (?,?)'%(name,password)) 这种写法是直接将参数拼接到sql语句中,这样数据库就容易被sql注入攻击,比如
cursor.execute('select * from user where user=%s and password=%s'%(name,password)) 要是name和password都等于'a or 1=1',那么这个语句会把整个user表都查询出来
- 默认环境
- 默认使用的环境文件为:mysql.env
Metadata
Release files for fastmysql 0.3.9
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 | |
|---|---|---|---|---|
| fastmysql-0.3.9.tar.gz | 30.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastmysql-0.3.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.1 kB
Release files / fastmysql-0.3.9.tar.gz
| Download URL | fastmysql-0.3.9.tar.gz |
|---|---|
| Size | 30.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5afc4840e32c5ea74ad4700a1fa33f972986aeddeb5ecdee24a4bd354e91a8f3
|
|
BLAKE2b-256 checksum How to use checksums |
4d40b91fd480ae82718b179d8530bc0507183126d8d0df02ca942e5f1ae6e8ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / fastmysql-0.3.9-py3-none-any.whl
| Download URL | fastmysql-0.3.9-py3-none-any.whl |
|---|---|
| Size | 34.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63f57d0f0f04fd061d79db22f6fa8274728ceaa2f60b9de77458a63d325ecaf2
|
|
BLAKE2b-256 checksum How to use checksums |
342526191ec4e07a874cfdb51ad1283f7519f9331cb730b0e4eea4c36fe440fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for fastmysql 0.3.9
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.