SQLExecX 2.2.1__tar.gz → 2.2.2__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.
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/PKG-INFO +5 -2
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/SQLExecX.egg-info/PKG-INFO +5 -2
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/setup.py +1 -1
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/exec.py +24 -24
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/table_exec.py +3 -2
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/LICENSE +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/README.rst +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/SQLExecX.egg-info/SOURCES.txt +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/SQLExecX.egg-info/dependency_links.txt +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/SQLExecX.egg-info/not-zip-safe +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/SQLExecX.egg-info/requires.txt +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/SQLExecX.egg-info/top_level.txt +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/setup.cfg +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/__init__.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/constant.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/dialect.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/loader.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/log_support.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/page_exec.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/sql_exec.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/sql_support.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/table_limit_exec.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/table_order_by.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/table_page_exec.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/table_support.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/sqlexecx/utils.py +0 -0
- {SQLExecX-2.2.1 → SQLExecX-2.2.2}/test/test.py +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SQLExecX
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A easy, fast sql executor for Python. Supported MySQL, PostgreSQL, SQLite etc.
|
|
5
5
|
Home-page: https://gitee.com/summry/sqlexecx
|
|
6
6
|
Author: summy
|
|
7
7
|
Author-email: fkfkfk2024@2925.com
|
|
8
|
+
License: UNKNOWN
|
|
8
9
|
Keywords: SQL,MySQL,PostgreSQL,SQLite,Database,Python,RDB
|
|
10
|
+
Platform: UNKNOWN
|
|
9
11
|
Requires-Python: >=3.6
|
|
10
12
|
Description-Content-Type: text/markdown
|
|
11
13
|
License-File: LICENSE
|
|
12
|
-
Requires-Dist: sqlexecutorx>=1.8.7
|
|
13
14
|
|
|
14
15
|
Usage Sample
|
|
15
16
|
''''''''''''
|
|
@@ -196,3 +197,5 @@ If you want to operate MySQL database like Mybatis, may be you need MySQLX: http
|
|
|
196
197
|
If you want to operate PostgreSQL databaselike Mybatis, may be you need PgSQLX: https://pypi.org/project/pgsqlx
|
|
197
198
|
|
|
198
199
|
If you wanted simultaneously support MySQL and PostgreSQL, may be you need BatisX: https://pypi.org/project/batisx
|
|
200
|
+
|
|
201
|
+
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SQLExecX
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: A easy, fast sql executor for Python. Supported MySQL, PostgreSQL, SQLite etc.
|
|
5
5
|
Home-page: https://gitee.com/summry/sqlexecx
|
|
6
6
|
Author: summy
|
|
7
7
|
Author-email: fkfkfk2024@2925.com
|
|
8
|
+
License: UNKNOWN
|
|
8
9
|
Keywords: SQL,MySQL,PostgreSQL,SQLite,Database,Python,RDB
|
|
10
|
+
Platform: UNKNOWN
|
|
9
11
|
Requires-Python: >=3.6
|
|
10
12
|
Description-Content-Type: text/markdown
|
|
11
13
|
License-File: LICENSE
|
|
12
|
-
Requires-Dist: sqlexecutorx>=1.8.7
|
|
13
14
|
|
|
14
15
|
Usage Sample
|
|
15
16
|
''''''''''''
|
|
@@ -196,3 +197,5 @@ If you want to operate MySQL database like Mybatis, may be you need MySQLX: http
|
|
|
196
197
|
If you want to operate PostgreSQL databaselike Mybatis, may be you need PgSQLX: https://pypi.org/project/pgsqlx
|
|
197
198
|
|
|
198
199
|
If you wanted simultaneously support MySQL and PostgreSQL, may be you need BatisX: https://pypi.org/project/batisx
|
|
200
|
+
|
|
201
|
+
|
|
@@ -17,7 +17,7 @@ setup(
|
|
|
17
17
|
description="A easy, fast sql executor for Python. Supported MySQL, PostgreSQL, SQLite etc.",
|
|
18
18
|
long_description=long_description,
|
|
19
19
|
long_description_content_type='text/markdown',
|
|
20
|
-
version='2.2.
|
|
20
|
+
version='2.2.2',
|
|
21
21
|
install_requires=[
|
|
22
22
|
'sqlexecutorx>=1.8.7',
|
|
23
23
|
],
|
|
@@ -297,10 +297,10 @@ def do_execute(sql: str, *args) -> int:
|
|
|
297
297
|
1
|
|
298
298
|
"""
|
|
299
299
|
# 判断*args是否为空,如果为空,则不传递*args给_execute函数
|
|
300
|
-
if
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
return _execute(sql
|
|
300
|
+
if args:
|
|
301
|
+
sql = Dialect.before_execute(sql)
|
|
302
|
+
return _execute(sql, *args)
|
|
303
|
+
return _execute(sql)
|
|
304
304
|
|
|
305
305
|
|
|
306
306
|
def do_save_sql(sql: str, *args) -> Any:
|
|
@@ -343,10 +343,10 @@ def do_save_sql_select_key(select_key: str, sql: str, *args) -> Any:
|
|
|
343
343
|
>>> db.do_save_sql_select_key(select_key, sql, '张三', 20)
|
|
344
344
|
3
|
|
345
345
|
"""
|
|
346
|
-
if
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
return _save(select_key, sql
|
|
346
|
+
if args:
|
|
347
|
+
sql = Dialect.before_execute(sql)
|
|
348
|
+
return _save(select_key, sql, *args)
|
|
349
|
+
return _save(select_key, sql)
|
|
350
350
|
|
|
351
351
|
|
|
352
352
|
def do_get(sql: str, *args) -> Any:
|
|
@@ -379,10 +379,10 @@ def do_select(sql: str, *args) -> List[Tuple[Any, ...]]:
|
|
|
379
379
|
>>> db.do_select(sql, '张三', 20)
|
|
380
380
|
[(3, '张三', 20)]
|
|
381
381
|
"""
|
|
382
|
-
if
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
return _select(sql
|
|
382
|
+
if args:
|
|
383
|
+
sql = Dialect.before_execute(sql)
|
|
384
|
+
return _select(sql, *args)
|
|
385
|
+
return _select(sql)
|
|
386
386
|
|
|
387
387
|
|
|
388
388
|
def do_select_one(sql: str, *args) -> Tuple[Any, ...]:
|
|
@@ -413,10 +413,10 @@ def do_query(sql: str, *args) -> List[dict[str, Any]]:
|
|
|
413
413
|
>>> db.do_query(sql, '张三', 20)
|
|
414
414
|
[{'id': 3, 'name': '张三', 'age': 20}]
|
|
415
415
|
"""
|
|
416
|
-
if
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
return _query(sql
|
|
416
|
+
if args:
|
|
417
|
+
sql = Dialect.before_execute(sql)
|
|
418
|
+
return _query(sql, *args)
|
|
419
|
+
return _query(sql)
|
|
420
420
|
|
|
421
421
|
|
|
422
422
|
def do_query_one(sql: str, *args) -> dict[str, Any]:
|
|
@@ -481,10 +481,10 @@ def do_ravel_list(sql: str, *args, position: int = 0) -> List:
|
|
|
481
481
|
>>> db.do_ravel_list(sql, 20)
|
|
482
482
|
['张三', '李四', '王五']
|
|
483
483
|
"""
|
|
484
|
-
if
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
return _ravel_list(sql,
|
|
484
|
+
if args:
|
|
485
|
+
sql = Dialect.before_execute(sql)
|
|
486
|
+
return _ravel_list(sql, *args, position=position)
|
|
487
|
+
return _ravel_list(sql, position=position)
|
|
488
488
|
|
|
489
489
|
|
|
490
490
|
def select_page(sql: str, page_num=1, page_size=10, *args, **kwargs) -> List[Tuple]:
|
|
@@ -652,10 +652,10 @@ def do_load(sql: str, *args) -> Loader:
|
|
|
652
652
|
>>> db.do_load(sql, '张三', 20)
|
|
653
653
|
Lodder()
|
|
654
654
|
"""
|
|
655
|
-
if
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
return Loader(*_do_select(sql
|
|
655
|
+
if args:
|
|
656
|
+
sql = Dialect.before_execute(sql)
|
|
657
|
+
return Loader(*_do_select(sql, *args))
|
|
658
|
+
return Loader(*_do_select(sql))
|
|
659
659
|
|
|
660
660
|
|
|
661
661
|
def insert_from_df(df, table_name: str, columns: Collection[str] = None) -> int:
|
|
@@ -721,7 +721,7 @@ class Table:
|
|
|
721
721
|
(3, '张三', 20)
|
|
722
722
|
"""
|
|
723
723
|
sql = get_table_select_sql(self.table, None, None, 0, *columns)
|
|
724
|
-
return self.exec.
|
|
724
|
+
return self.exec.do_select_first(sql)
|
|
725
725
|
|
|
726
726
|
def query(self, *columns) -> List[dict]:
|
|
727
727
|
"""
|
|
@@ -760,7 +760,7 @@ class Table:
|
|
|
760
760
|
{'id': 3, 'name': '张三', 'age': 20}
|
|
761
761
|
"""
|
|
762
762
|
sql = get_table_select_sql(self.table, None, None, 0, *columns)
|
|
763
|
-
return self.exec.
|
|
763
|
+
return self.exec.do_query_first(sql)
|
|
764
764
|
|
|
765
765
|
def ravel_list(self, column: str) -> List:
|
|
766
766
|
"""
|
|
@@ -801,6 +801,7 @@ class Table:
|
|
|
801
801
|
20
|
|
802
802
|
"""
|
|
803
803
|
return self.exec.insert_from_df(df, self.table, columns)
|
|
804
|
+
|
|
804
805
|
def insert_from_pl(self, df, columns: Tuple[str] = None):
|
|
805
806
|
"""
|
|
806
807
|
从polars DataFrame插入数据到表中并返回影响的行数。
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|