MySQLX 2.2.1__tar.gz → 2.2.3__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.
- {mysqlx-2.2.1 → mysqlx-2.2.3}/PKG-INFO +1 -1
- mysqlx-2.2.3/mysqlx/constant.py +9 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/db.py +6 -6
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/sql_support.py +4 -6
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx.egg-info/PKG-INFO +1 -1
- {mysqlx-2.2.1 → mysqlx-2.2.3}/setup.py +1 -1
- mysqlx-2.2.1/mysqlx/constant.py +0 -13
- {mysqlx-2.2.1 → mysqlx-2.2.3}/LICENSE +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/README.rst +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/__init__.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/dbx.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/log_support.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/sql_holder.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/sql_id_exec.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/sql_mapper.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/sql_page_exec.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx/support.py +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx.egg-info/SOURCES.txt +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx.egg-info/dependency_links.txt +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx.egg-info/not-zip-safe +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx.egg-info/requires.txt +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/mysqlx.egg-info/top_level.txt +0 -0
- {mysqlx-2.2.1 → mysqlx-2.2.3}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mysqlx
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions. It also provides ORM operations for single tables.
|
|
5
5
|
Home-page: https://gitee.com/summry/mysqlx
|
|
6
6
|
Author: summy
|
|
@@ -11,7 +11,7 @@ def execute(sql: str, *args, **kwargs):
|
|
|
11
11
|
sql: INSERT INTO user(name, age) VALUES(?, ?) --> args: ('张三', 20)
|
|
12
12
|
INSERT INTO user(name, age) VALUES(:name,:age) --> kwargs: {'name': '张三', 'age': 20}
|
|
13
13
|
"""
|
|
14
|
-
sql, args = sql_support.try_dynamic_sql('
|
|
14
|
+
sql, args = sql_support.try_dynamic_sql('MySQLX.db.execute', sql, *args, **kwargs)
|
|
15
15
|
return do_execute(sql, *args)
|
|
16
16
|
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ def get(sql: str, *args, **kwargs):
|
|
|
23
23
|
sql: SELECT count(1) FROM user WHERE name=? and age=? limit 1 --> args: ('张三', 20)
|
|
24
24
|
SELECT count(1) FROM user WHERE name=:name and age=:age limit 1 --> kwargs: ('张三', 20) --> kwargs: {'name': '张三', 'age': 20}
|
|
25
25
|
"""
|
|
26
|
-
sql, args = sql_support.try_dynamic_sql('
|
|
26
|
+
sql, args = sql_support.try_dynamic_sql('MySQLX.db.get', sql, *args, **kwargs)
|
|
27
27
|
return do_get(sql, *args)
|
|
28
28
|
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ def query(sql: str, *args, **kwargs):
|
|
|
33
33
|
sql: SELECT * FROM user WHERE name=? and age=? --> args: ('张三', 20)
|
|
34
34
|
SELECT * FROM user WHERE name=:name and age=:age --> kwargs: ('张三', 20) --> kwargs: {'name': '张三', 'age': 20}
|
|
35
35
|
"""
|
|
36
|
-
sql, args = sql_support.try_dynamic_sql('
|
|
36
|
+
sql, args = sql_support.try_dynamic_sql('MySQLX.db.query', sql, *args, **kwargs)
|
|
37
37
|
return do_query(sql, *args)
|
|
38
38
|
|
|
39
39
|
|
|
@@ -45,7 +45,7 @@ def query_one(sql: str, *args, **kwargs):
|
|
|
45
45
|
sql: SELECT * FROM user WHERE name=? and age=? limit 1 --> args: ('张三', 20)
|
|
46
46
|
SELECT * FROM user WHERE name=:name and age=:age limit 1 --> kwargs: ('张三', 20) --> kwargs: {'name': '张三', 'age': 20}
|
|
47
47
|
"""
|
|
48
|
-
sql, args = sql_support.try_dynamic_sql('
|
|
48
|
+
sql, args = sql_support.try_dynamic_sql('MySQLX.db.query_one', sql, *args, **kwargs)
|
|
49
49
|
return do_query_one(sql, *args)
|
|
50
50
|
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ def select(sql: str, *args, **kwargs):
|
|
|
55
55
|
sql: SELECT * FROM user WHERE name=? and age=? --> args: ('张三', 20)
|
|
56
56
|
SELECT * FROM user WHERE name=:name and age=:age --> kwargs: ('张三', 20) --> kwargs: {'name': '张三', 'age': 20}
|
|
57
57
|
"""
|
|
58
|
-
sql, args = sql_support.try_dynamic_sql('
|
|
58
|
+
sql, args = sql_support.try_dynamic_sql('MySQLX.db.select', sql, *args, **kwargs)
|
|
59
59
|
return do_select(sql, *args)
|
|
60
60
|
|
|
61
61
|
|
|
@@ -67,7 +67,7 @@ def select_one(sql: str, *args, **kwargs):
|
|
|
67
67
|
sql: SELECT * FROM user WHERE name=? and age=? limit 1 --> args: ('张三', 20)
|
|
68
68
|
SELECT * FROM user WHERE name=:name and age=:age limit 1 --> kwargs: ('张三', 20) --> kwargs: {'name': '张三', 'age': 20}
|
|
69
69
|
"""
|
|
70
|
-
sql, args = sql_support.try_dynamic_sql('
|
|
70
|
+
sql, args = sql_support.try_dynamic_sql('MySQLX.db.select_one', sql, *args, **kwargs)
|
|
71
71
|
return do_select_one(sql, *args)
|
|
72
72
|
|
|
73
73
|
|
|
@@ -2,11 +2,9 @@ import re
|
|
|
2
2
|
from jinja2 import Template
|
|
3
3
|
from functools import lru_cache
|
|
4
4
|
from .log_support import page_log
|
|
5
|
-
from .constant import DYNAMIC_REGEX,
|
|
5
|
+
from .constant import DYNAMIC_REGEX, SQL_CACHE_SIZE
|
|
6
6
|
|
|
7
|
-
from sqlexecx.
|
|
8
|
-
# Don't remove. Import for not repetitive implementation
|
|
9
|
-
from sqlexecx.sql_support import get_batch_args, get_named_sql_args, is_mapping, get_mapping_sql_args, require_limit, try_mapping
|
|
7
|
+
from sqlexecx.sql_support import get_named_sql_args, is_mapping, get_mapping_sql_args, try_mapping, get_batch_args
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
def simple_sql(sql: str, *args, **kwargs):
|
|
@@ -25,12 +23,12 @@ def get_page_start(page_num: int, page_size: int):
|
|
|
25
23
|
return (page_num - 1) * page_size
|
|
26
24
|
|
|
27
25
|
|
|
28
|
-
@lru_cache(maxsize=
|
|
26
|
+
@lru_cache(maxsize=SQL_CACHE_SIZE)
|
|
29
27
|
def is_dynamic_sql(sql: str):
|
|
30
28
|
return re.search(DYNAMIC_REGEX, sql) is not None
|
|
31
29
|
|
|
32
30
|
|
|
33
|
-
@lru_cache(maxsize=
|
|
31
|
+
@lru_cache(maxsize=SQL_CACHE_SIZE)
|
|
34
32
|
def _get_sql_type(sql: str):
|
|
35
33
|
"""
|
|
36
34
|
:return: 0: placeholder, 1: dynamic, 2: named mapping
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mysqlx
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: A thread safe sql executor for MySQL like MyBatis with connection pool. It helps you automatically manage database connections and transactions. It also provides ORM operations for single tables.
|
|
5
5
|
Home-page: https://gitee.com/summry/mysqlx
|
|
6
6
|
Author: summy
|
mysqlx-2.2.1/mysqlx/constant.py
DELETED
|
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
|